3 #define PY_SSIZE_T_CLEAN
6 #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
8 #error Cython requires Python 2.6+ or Python 3.2+.
10 #define CYTHON_ABI "0_23_3"
13 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #if !defined(WIN32) && !defined(MS_WINDOWS)
27 #define DL_IMPORT(t) t
30 #define DL_EXPORT(t) t
33 #define PY_LONG_LONG LONG_LONG
36 #define Py_HUGE_VAL HUGE_VAL
39 #define CYTHON_COMPILING_IN_PYPY 1
40 #define CYTHON_COMPILING_IN_CPYTHON 0
42 #define CYTHON_COMPILING_IN_PYPY 0
43 #define CYTHON_COMPILING_IN_CPYTHON 1
45 #if !defined(CYTHON_USE_PYLONG_INTERNALS) && CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x02070000
46 #define CYTHON_USE_PYLONG_INTERNALS 1
48 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
49 #define Py_OptimizeFlag 0
51 #define __PYX_BUILD_PY_SSIZE_T "n"
52 #define CYTHON_FORMAT_SSIZE_T "z"
53 #if PY_MAJOR_VERSION < 3
54 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
55 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
56 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
57 #define __Pyx_DefaultClassType PyClass_Type
59 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
60 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
61 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
62 #define __Pyx_DefaultClassType PyType_Type
64 #ifndef Py_TPFLAGS_CHECKTYPES
65 #define Py_TPFLAGS_CHECKTYPES 0
67 #ifndef Py_TPFLAGS_HAVE_INDEX
68 #define Py_TPFLAGS_HAVE_INDEX 0
70 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
71 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
73 #ifndef Py_TPFLAGS_HAVE_FINALIZE
74 #define Py_TPFLAGS_HAVE_FINALIZE 0
76 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
77 #define CYTHON_PEP393_ENABLED 1
78 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
79 0 : _PyUnicode_Ready((PyObject *)(op)))
80 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
81 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
82 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
83 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
84 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
86 #define CYTHON_PEP393_ENABLED 0
87 #define __Pyx_PyUnicode_READY(op) (0)
88 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
89 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
90 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
91 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
92 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
94 #if CYTHON_COMPILING_IN_PYPY
95 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
96 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
98 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
99 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
100 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
102 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
103 #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
105 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
106 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
107 #if PY_MAJOR_VERSION >= 3
108 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
110 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
112 #if PY_MAJOR_VERSION >= 3
113 #define PyBaseString_Type PyUnicode_Type
114 #define PyStringObject PyUnicodeObject
115 #define PyString_Type PyUnicode_Type
116 #define PyString_Check PyUnicode_Check
117 #define PyString_CheckExact PyUnicode_CheckExact
119 #if PY_MAJOR_VERSION >= 3
120 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
121 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
123 #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
124 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
126 #ifndef PySet_CheckExact
127 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
129 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
130 #if PY_MAJOR_VERSION >= 3
131 #define PyIntObject PyLongObject
132 #define PyInt_Type PyLong_Type
133 #define PyInt_Check(op) PyLong_Check(op)
134 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
135 #define PyInt_FromString PyLong_FromString
136 #define PyInt_FromUnicode PyLong_FromUnicode
137 #define PyInt_FromLong PyLong_FromLong
138 #define PyInt_FromSize_t PyLong_FromSize_t
139 #define PyInt_FromSsize_t PyLong_FromSsize_t
140 #define PyInt_AsLong PyLong_AsLong
141 #define PyInt_AS_LONG PyLong_AS_LONG
142 #define PyInt_AsSsize_t PyLong_AsSsize_t
143 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
144 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
145 #define PyNumber_Int PyNumber_Long
147 #if PY_MAJOR_VERSION >= 3
148 #define PyBoolObject PyLongObject
150 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
151 #ifndef PyUnicode_InternFromString
152 #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
155 #if PY_VERSION_HEX < 0x030200A4
156 typedef long Py_hash_t;
157 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
158 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
160 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
161 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
163 #if PY_MAJOR_VERSION >= 3
164 #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
166 #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
168 #if PY_VERSION_HEX >= 0x030500B1
169 #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
170 #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
171 #elif CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
176 } __Pyx_PyAsyncMethodsStruct;
177 #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
179 #define __Pyx_PyType_AsAsync(obj) NULL
181 #ifndef CYTHON_RESTRICT
182 #if defined(__GNUC__)
183 #define CYTHON_RESTRICT __restrict__
184 #elif defined(_MSC_VER) && _MSC_VER >= 1400
185 #define CYTHON_RESTRICT __restrict
186 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
187 #define CYTHON_RESTRICT restrict
189 #define CYTHON_RESTRICT
192 #define __Pyx_void_to_None(void_result) (void_result, Py_INCREF(Py_None), Py_None)
194 #ifndef CYTHON_INLINE
195 #if defined(__GNUC__)
196 #define CYTHON_INLINE __inline__
197 #elif defined(_MSC_VER)
198 #define CYTHON_INLINE __inline
199 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
200 #define CYTHON_INLINE inline
202 #define CYTHON_INLINE
206 #if defined(WIN32) || defined(MS_WINDOWS)
207 #define _USE_MATH_DEFINES
211 #define __PYX_NAN() ((float) NAN)
213 static CYTHON_INLINE
float __PYX_NAN() {
215 memset(&value, 0xFF,
sizeof(value));
221 #if PY_MAJOR_VERSION >= 3
222 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
223 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
225 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
226 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
229 #ifndef __PYX_EXTERN_C
231 #define __PYX_EXTERN_C extern "C"
233 #define __PYX_EXTERN_C extern
237 #define __PYX_HAVE__subsurfaceTransportFunctions
238 #define __PYX_HAVE_API__subsurfaceTransportFunctions
242 #include "numpy/arrayobject.h"
243 #include "numpy/ufuncobject.h"
249 #ifdef PYREX_WITHOUT_ASSERTIONS
250 #define CYTHON_WITHOUT_ASSERTIONS
253 #ifndef CYTHON_UNUSED
254 # if defined(__GNUC__)
255 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
256 # define CYTHON_UNUSED __attribute__ ((__unused__))
258 # define CYTHON_UNUSED
260 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
261 # define CYTHON_UNUSED __attribute__ ((__unused__))
263 # define CYTHON_UNUSED
266 #ifndef CYTHON_NCP_UNUSED
267 # if CYTHON_COMPILING_IN_CPYTHON
268 # define CYTHON_NCP_UNUSED
270 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
273 typedef struct {PyObject **p;
char *s;
const Py_ssize_t n;
const char* encoding;
274 const char is_unicode;
const char is_str;
const char intern; } __Pyx_StringTabEntry;
276 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
277 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
278 #define __PYX_DEFAULT_STRING_ENCODING ""
279 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
280 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
281 #define __Pyx_uchar_cast(c) ((unsigned char)c)
282 #define __Pyx_long_cast(x) ((long)x)
283 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
284 (sizeof(type) < sizeof(Py_ssize_t)) ||\
285 (sizeof(type) > sizeof(Py_ssize_t) &&\
286 likely(v < (type)PY_SSIZE_T_MAX ||\
287 v == (type)PY_SSIZE_T_MAX) &&\
288 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
289 v == (type)PY_SSIZE_T_MIN))) ||\
290 (sizeof(type) == sizeof(Py_ssize_t) &&\
291 (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
292 v == (type)PY_SSIZE_T_MAX))) )
293 #if defined (__cplusplus) && __cplusplus >= 201103L
295 #define __Pyx_sst_abs(value) std::abs(value)
296 #elif SIZEOF_INT >= SIZEOF_SIZE_T
297 #define __Pyx_sst_abs(value) abs(value)
298 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
299 #define __Pyx_sst_abs(value) labs(value)
300 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
301 #define __Pyx_sst_abs(value) llabs(value)
302 #elif defined (_MSC_VER) && defined (_M_X64)
303 #define __Pyx_sst_abs(value) _abs64(value)
304 #elif defined (__GNUC__)
305 #define __Pyx_sst_abs(value) __builtin_llabs(value)
307 #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
309 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject*);
310 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
311 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
312 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
313 #define __Pyx_PyBytes_FromString PyBytes_FromString
314 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
315 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char*);
316 #if PY_MAJOR_VERSION < 3
317 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
318 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
320 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
321 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
323 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
324 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
325 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
326 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
327 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
328 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
329 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
330 #if PY_MAJOR_VERSION < 3
331 static CYTHON_INLINE
size_t __Pyx_Py_UNICODE_strlen(
const Py_UNICODE *u)
333 const Py_UNICODE *u_end = u;
335 return (
size_t)(u_end - u - 1);
338 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
340 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
341 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
342 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
343 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
344 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
345 #define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
346 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject*);
347 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
348 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
349 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t);
350 #if CYTHON_COMPILING_IN_CPYTHON
351 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
353 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
355 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
356 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
357 static int __Pyx_sys_getdefaultencoding_not_ascii;
358 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
360 PyObject* default_encoding = NULL;
361 PyObject* ascii_chars_u = NULL;
362 PyObject* ascii_chars_b = NULL;
363 const char* default_encoding_c;
364 sys = PyImport_ImportModule(
"sys");
366 default_encoding = PyObject_CallMethod(sys, (
char*)
"getdefaultencoding", NULL);
368 if (!default_encoding)
goto bad;
369 default_encoding_c = PyBytes_AsString(default_encoding);
370 if (!default_encoding_c)
goto bad;
371 if (strcmp(default_encoding_c,
"ascii") == 0) {
372 __Pyx_sys_getdefaultencoding_not_ascii = 0;
374 char ascii_chars[128];
376 for (c = 0; c < 128; c++) {
379 __Pyx_sys_getdefaultencoding_not_ascii = 1;
380 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
381 if (!ascii_chars_u)
goto bad;
382 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
383 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
386 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
390 Py_DECREF(ascii_chars_u);
391 Py_DECREF(ascii_chars_b);
393 Py_DECREF(default_encoding);
396 Py_XDECREF(default_encoding);
397 Py_XDECREF(ascii_chars_u);
398 Py_XDECREF(ascii_chars_b);
402 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
403 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
405 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
406 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
407 static char* __PYX_DEFAULT_STRING_ENCODING;
408 static int __Pyx_init_sys_getdefaultencoding_params(
void) {
410 PyObject* default_encoding = NULL;
411 char* default_encoding_c;
412 sys = PyImport_ImportModule(
"sys");
414 default_encoding = PyObject_CallMethod(sys, (
char*) (
const char*)
"getdefaultencoding", NULL);
416 if (!default_encoding)
goto bad;
417 default_encoding_c = PyBytes_AsString(default_encoding);
418 if (!default_encoding_c)
goto bad;
419 __PYX_DEFAULT_STRING_ENCODING = (
char*) malloc(strlen(default_encoding_c));
420 if (!__PYX_DEFAULT_STRING_ENCODING)
goto bad;
421 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
422 Py_DECREF(default_encoding);
425 Py_XDECREF(default_encoding);
433 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
434 #define likely(x) __builtin_expect(!!(x), 1)
435 #define unlikely(x) __builtin_expect(!!(x), 0)
437 #define likely(x) (x)
438 #define unlikely(x) (x)
441 static PyObject *__pyx_m;
442 static PyObject *__pyx_d;
443 static PyObject *__pyx_b;
444 static PyObject *__pyx_empty_tuple;
445 static PyObject *__pyx_empty_bytes;
446 static int __pyx_lineno;
447 static int __pyx_clineno = 0;
448 static const char * __pyx_cfilenm= __FILE__;
449 static const char *__pyx_filename;
451 #if !defined(CYTHON_CCOMPLEX)
452 #if defined(__cplusplus)
453 #define CYTHON_CCOMPLEX 1
454 #elif defined(_Complex_I)
455 #define CYTHON_CCOMPLEX 1
457 #define CYTHON_CCOMPLEX 0
467 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
469 #define _Complex_I 1.0fj
473 static const char *__pyx_f[] = {
474 "proteus/subsurfaceTransportFunctions.pyx",
475 "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
476 "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
478 #define IS_UNSIGNED(type) (((type) -1) > 0)
479 struct __Pyx_StructField_;
480 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
483 struct __Pyx_StructField_* fields;
491 typedef struct __Pyx_StructField_ {
492 __Pyx_TypeInfo* type;
497 __Pyx_StructField* field;
498 size_t parent_offset;
499 } __Pyx_BufFmt_StackElem;
501 __Pyx_StructField root;
502 __Pyx_BufFmt_StackElem* head;
504 size_t new_count, enc_count;
505 size_t struct_alignment;
511 } __Pyx_BufFmt_Context;
521 typedef npy_int8 __pyx_t_5numpy_int8_t;
530 typedef npy_int16 __pyx_t_5numpy_int16_t;
539 typedef npy_int32 __pyx_t_5numpy_int32_t;
548 typedef npy_int64 __pyx_t_5numpy_int64_t;
557 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
566 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
575 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
584 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
593 typedef npy_float32 __pyx_t_5numpy_float32_t;
602 typedef npy_float64 __pyx_t_5numpy_float64_t;
611 typedef npy_long __pyx_t_5numpy_int_t;
620 typedef npy_longlong __pyx_t_5numpy_long_t;
629 typedef npy_longlong __pyx_t_5numpy_longlong_t;
638 typedef npy_ulong __pyx_t_5numpy_uint_t;
647 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
656 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
665 typedef npy_intp __pyx_t_5numpy_intp_t;
674 typedef npy_uintp __pyx_t_5numpy_uintp_t;
683 typedef npy_double __pyx_t_5numpy_float_t;
692 typedef npy_double __pyx_t_5numpy_double_t;
701 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
710 typedef __pyx_t_5numpy_double_t __pyx_t_28subsurfaceTransportFunctions_DTYPE_t;
719 typedef int __pyx_t_28subsurfaceTransportFunctions_ITYPE_t;
722 typedef ::std::complex< float > __pyx_t_float_complex;
724 typedef float _Complex __pyx_t_float_complex;
727 typedef struct {
float real, imag; } __pyx_t_float_complex;
732 typedef ::std::complex< double > __pyx_t_double_complex;
734 typedef double _Complex __pyx_t_double_complex;
737 typedef struct {
double real, imag; } __pyx_t_double_complex;
750 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
759 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
768 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
777 typedef npy_cdouble __pyx_t_5numpy_complex_t;
780 #ifndef CYTHON_REFNANNY
781 #define CYTHON_REFNANNY 0
785 void (*INCREF)(
void*, PyObject*, int);
786 void (*DECREF)(
void*, PyObject*, int);
787 void (*GOTREF)(
void*, PyObject*, int);
788 void (*GIVEREF)(
void*, PyObject*, int);
789 void* (*SetupContext)(
const char*, int,
const char*);
790 void (*FinishContext)(
void**);
791 } __Pyx_RefNannyAPIStruct;
792 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
793 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname);
794 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
796 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
798 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
799 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
800 PyGILState_Release(__pyx_gilstate_save);\
802 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
805 #define __Pyx_RefNannySetupContext(name, acquire_gil)\
806 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
808 #define __Pyx_RefNannyFinishContext()\
809 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
810 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
811 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
812 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
813 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
814 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
815 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
816 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
817 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
819 #define __Pyx_RefNannyDeclarations
820 #define __Pyx_RefNannySetupContext(name, acquire_gil)
821 #define __Pyx_RefNannyFinishContext()
822 #define __Pyx_INCREF(r) Py_INCREF(r)
823 #define __Pyx_DECREF(r) Py_DECREF(r)
824 #define __Pyx_GOTREF(r)
825 #define __Pyx_GIVEREF(r)
826 #define __Pyx_XINCREF(r) Py_XINCREF(r)
827 #define __Pyx_XDECREF(r) Py_XDECREF(r)
828 #define __Pyx_XGOTREF(r)
829 #define __Pyx_XGIVEREF(r)
831 #define __Pyx_XDECREF_SET(r, v) do {\
832 PyObject *tmp = (PyObject *) r;\
833 r = v; __Pyx_XDECREF(tmp);\
835 #define __Pyx_DECREF_SET(r, v) do {\
836 PyObject *tmp = (PyObject *) r;\
837 r = v; __Pyx_DECREF(tmp);\
839 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
840 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
842 #if CYTHON_COMPILING_IN_CPYTHON
843 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
844 PyTypeObject* tp = Py_TYPE(obj);
845 if (likely(tp->tp_getattro))
846 return tp->tp_getattro(obj, attr_name);
847 #if PY_MAJOR_VERSION < 3
848 if (likely(tp->tp_getattr))
849 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
851 return PyObject_GetAttr(obj, attr_name);
854 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
857 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
859 static void __Pyx_RaiseArgtupleInvalid(
const char* func_name,
int exact,
860 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
862 static void __Pyx_RaiseDoubleKeywordsError(
const char* func_name, PyObject* kw_name);
864 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
865 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
866 const char* function_name);
868 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
869 const char *name,
int exact);
871 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
872 __Pyx_TypeInfo* dtype,
int flags,
int nd,
int cast, __Pyx_BufFmt_StackElem* stack);
873 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info);
875 static void __Pyx_RaiseBufferIndexError(
int axis);
877 #define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
878 #define __Pyx_BufPtrStrided2d(type, buf, i0, s0, i1, s1) (type)((char*)buf + i0 * s0 + i1 * s1)
879 static CYTHON_INLINE
void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb);
880 static CYTHON_INLINE
void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb);
882 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
883 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
885 value = PyDict_GetItemWithError(d, key);
886 if (unlikely(!value)) {
887 if (!PyErr_Occurred()) {
888 PyObject* args = PyTuple_Pack(1, key);
890 PyErr_SetObject(PyExc_KeyError, args);
899 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
902 #define __Pyx_BufPtrStrided3d(type, buf, i0, s0, i1, s1, i2, s2) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2)
903 #if CYTHON_COMPILING_IN_CPYTHON
904 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval,
int inplace);
906 #define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace)\
907 (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
910 #define __Pyx_BufPtrStrided4d(type, buf, i0, s0, i1, s1, i2, s2, i3, s3) (type)((char*)buf + i0 * s0 + i1 * s1 + i2 * s2 + i3 * s3)
911 #if CYTHON_COMPILING_IN_CPYTHON
912 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
914 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
917 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
919 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
921 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
922 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
923 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
924 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
925 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
926 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
927 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
928 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
929 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
930 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
931 int wraparound,
int boundscheck);
932 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
933 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
934 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
935 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
936 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
937 int wraparound,
int boundscheck);
938 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
939 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
940 int is_list,
int wraparound,
int boundscheck);
942 #if CYTHON_COMPILING_IN_CPYTHON
943 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
946 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
948 static double __Pyx__PyObject_AsDouble(PyObject* obj);
949 #if CYTHON_COMPILING_IN_PYPY
950 #define __Pyx_PyObject_AsDouble(obj)\
951 (likely(PyFloat_CheckExact(obj)) ? PyFloat_AS_DOUBLE(obj) :\
952 likely(PyInt_CheckExact(obj)) ?\
953 PyFloat_AsDouble(obj) : __Pyx__PyObject_AsDouble(obj))
955 #define __Pyx_PyObject_AsDouble(obj)\
956 ((likely(PyFloat_CheckExact(obj))) ?\
957 PyFloat_AS_DOUBLE(obj) : __Pyx__PyObject_AsDouble(obj))
960 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
962 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
964 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
966 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void);
968 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level);
972 PyCodeObject* code_object;
973 } __Pyx_CodeObjectCacheEntry;
974 struct __Pyx_CodeObjectCache {
977 __Pyx_CodeObjectCacheEntry* entries;
979 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
980 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line);
981 static PyCodeObject *__pyx_find_code_object(
int code_line);
982 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object);
984 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
985 int py_line,
const char *filename);
988 Py_ssize_t shape, strides, suboffsets;
995 __Pyx_Buffer *rcbuffer;
997 __Pyx_Buf_DimInfo diminfo[8];
1000 #if PY_MAJOR_VERSION < 3
1001 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags);
1002 static void __Pyx_ReleaseBuffer(Py_buffer *view);
1004 #define __Pyx_GetBuffer PyObject_GetBuffer
1005 #define __Pyx_ReleaseBuffer PyBuffer_Release
1009 static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
1010 static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
1012 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *);
1014 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value);
1016 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value);
1018 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *);
1020 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value);
1024 #define __Pyx_CREAL(z) ((z).real())
1025 #define __Pyx_CIMAG(z) ((z).imag())
1027 #define __Pyx_CREAL(z) (__real__(z))
1028 #define __Pyx_CIMAG(z) (__imag__(z))
1031 #define __Pyx_CREAL(z) ((z).real)
1032 #define __Pyx_CIMAG(z) ((z).imag)
1034 #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
1035 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
1036 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
1038 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
1039 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
1042 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float,
float);
1045 #define __Pyx_c_eqf(a, b) ((a)==(b))
1046 #define __Pyx_c_sumf(a, b) ((a)+(b))
1047 #define __Pyx_c_difff(a, b) ((a)-(b))
1048 #define __Pyx_c_prodf(a, b) ((a)*(b))
1049 #define __Pyx_c_quotf(a, b) ((a)/(b))
1050 #define __Pyx_c_negf(a) (-(a))
1052 #define __Pyx_c_is_zerof(z) ((z)==(float)0)
1053 #define __Pyx_c_conjf(z) (::std::conj(z))
1055 #define __Pyx_c_absf(z) (::std::abs(z))
1056 #define __Pyx_c_powf(a, b) (::std::pow(a, b))
1059 #define __Pyx_c_is_zerof(z) ((z)==0)
1060 #define __Pyx_c_conjf(z) (conjf(z))
1062 #define __Pyx_c_absf(z) (cabsf(z))
1063 #define __Pyx_c_powf(a, b) (cpowf(a, b))
1067 static CYTHON_INLINE
int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
1068 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
1069 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
1070 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
1071 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
1072 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
1073 static CYTHON_INLINE
int __Pyx_c_is_zerof(__pyx_t_float_complex);
1074 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
1076 static CYTHON_INLINE
float __Pyx_c_absf(__pyx_t_float_complex);
1077 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
1081 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double,
double);
1084 #define __Pyx_c_eq(a, b) ((a)==(b))
1085 #define __Pyx_c_sum(a, b) ((a)+(b))
1086 #define __Pyx_c_diff(a, b) ((a)-(b))
1087 #define __Pyx_c_prod(a, b) ((a)*(b))
1088 #define __Pyx_c_quot(a, b) ((a)/(b))
1089 #define __Pyx_c_neg(a) (-(a))
1091 #define __Pyx_c_is_zero(z) ((z)==(double)0)
1092 #define __Pyx_c_conj(z) (::std::conj(z))
1094 #define __Pyx_c_abs(z) (::std::abs(z))
1095 #define __Pyx_c_pow(a, b) (::std::pow(a, b))
1098 #define __Pyx_c_is_zero(z) ((z)==0)
1099 #define __Pyx_c_conj(z) (conj(z))
1101 #define __Pyx_c_abs(z) (cabs(z))
1102 #define __Pyx_c_pow(a, b) (cpow(a, b))
1106 static CYTHON_INLINE
int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
1107 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
1108 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
1109 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
1110 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
1111 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
1112 static CYTHON_INLINE
int __Pyx_c_is_zero(__pyx_t_double_complex);
1113 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
1115 static CYTHON_INLINE
double __Pyx_c_abs(__pyx_t_double_complex);
1116 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
1120 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value);
1122 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *);
1124 static int __Pyx_check_binary_version(
void);
1126 #if !defined(__Pyx_PyIdentifier_FromString)
1127 #if PY_MAJOR_VERSION < 3
1128 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
1130 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
1134 static PyObject *__Pyx_ImportModule(
const char *name);
1136 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
size_t size,
int strict);
1138 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
1150 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
1163 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
1164 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
1165 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
1166 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
1167 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
1168 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *,
char *,
char *,
int *);
1171 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t = {
"ITYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), { 0 }, 0, IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t) ?
'U' :
'I', IS_UNSIGNED(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t), 0 };
1172 static __Pyx_TypeInfo __Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t = {
"DTYPE_t", NULL,
sizeof(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t), { 0 }, 0,
'R', 0, 0 };
1173 #define __Pyx_MODULE_NAME "subsurfaceTransportFunctions"
1174 int __pyx_module_is_main_subsurfaceTransportFunctions = 0;
1177 static PyObject *__pyx_builtin_range;
1178 static PyObject *__pyx_builtin_ValueError;
1179 static PyObject *__pyx_builtin_RuntimeError;
1180 static char __pyx_k_B[] =
"B";
1181 static char __pyx_k_H[] =
"H";
1182 static char __pyx_k_I[] =
"I";
1183 static char __pyx_k_J[] =
"J";
1184 static char __pyx_k_L[] =
"L";
1185 static char __pyx_k_O[] =
"O";
1186 static char __pyx_k_Q[] =
"Q";
1187 static char __pyx_k_b[] =
"b";
1188 static char __pyx_k_d[] =
"d";
1189 static char __pyx_k_f[] =
"f";
1190 static char __pyx_k_g[] =
"g";
1191 static char __pyx_k_h[] =
"h";
1192 static char __pyx_k_i[] =
"i";
1193 static char __pyx_k_j[] =
"j";
1194 static char __pyx_k_k[] =
"k";
1195 static char __pyx_k_l[] =
"l";
1196 static char __pyx_k_m[] =
"m";
1197 static char __pyx_k_n[] =
"n";
1198 static char __pyx_k_q[] =
"q";
1199 static char __pyx_k_t[] =
"t";
1200 static char __pyx_k_v[] =
"v";
1201 static char __pyx_k_w[] =
"w";
1202 static char __pyx_k_x[] =
"x";
1203 static char __pyx_k_Zd[] =
"Zd";
1204 static char __pyx_k_Zf[] =
"Zf";
1205 static char __pyx_k_Zg[] =
"Zg";
1206 static char __pyx_k_dS[] =
"dS";
1207 static char __pyx_k_dV[] =
"dV";
1208 static char __pyx_k_df[] =
"df";
1209 static char __pyx_k_dm[] =
"dm";
1210 static char __pyx_k_eN[] =
"eN";
1211 static char __pyx_k_ii[] =
"ii";
1212 static char __pyx_k_kb[] =
"kb";
1213 static char __pyx_k_mt[] =
"mt";
1214 static char __pyx_k_nd[] =
"nd";
1215 static char __pyx_k_pi[] =
"pi";
1216 static char __pyx_k_xc[] =
"xc";
1217 static char __pyx_k_yc[] =
"yc";
1218 static char __pyx_k_KWr[] =
"KWr";
1219 static char __pyx_k_KWs[] =
"KWs";
1220 static char __pyx_k_dmt[] =
"dmt";
1221 static char __pyx_k_dot[] =
"dot";
1222 static char __pyx_k_ebN[] =
"ebN";
1223 static char __pyx_k_l2g[] =
"l2g";
1224 static char __pyx_k_nnz[] =
"nnz";
1225 static char __pyx_k_q_m[] =
"q_m";
1226 static char __pyx_k_q_r[] =
"q_r";
1227 static char __pyx_k_q_u[] =
"q_u";
1228 static char __pyx_k_q_x[] =
"q_x";
1229 static char __pyx_k_rho[] =
"rho";
1230 static char __pyx_k_sum[] =
"sum";
1231 static char __pyx_k_u_j[] =
"u_j";
1232 static char __pyx_k_vol[] =
"vol";
1233 static char __pyx_k_a_eN[] =
"a_eN";
1234 static char __pyx_k_a_up[] =
"a_up";
1235 static char __pyx_k_beta[] =
"beta";
1236 static char __pyx_k_ebNE[] =
"ebNE";
1237 static char __pyx_k_f_up[] =
"f_up";
1238 static char __pyx_k_flat[] =
"flat";
1239 static char __pyx_k_flux[] =
"flux";
1240 static char __pyx_k_main[] =
"__main__";
1241 static char __pyx_k_one8[] =
"one8";
1242 static char __pyx_k_psiC[] =
"psiC";
1243 static char __pyx_k_q_dm[] =
"q_dm";
1244 static char __pyx_k_q_kr[] =
"q_kr";
1245 static char __pyx_k_q_mt[] =
"q_mt";
1246 static char __pyx_k_rho2[] =
"rho2";
1247 static char __pyx_k_rhom[] =
"rhom";
1248 static char __pyx_k_sBar[] =
"sBar";
1249 static char __pyx_k_test[] =
"__test__";
1250 static char __pyx_k_u_eN[] =
"u_eN";
1251 static char __pyx_k_vBar[] =
"vBar";
1252 static char __pyx_k_a_avg[] =
"a_avg";
1253 static char __pyx_k_alpha[] =
"alpha";
1254 static char __pyx_k_clock[] =
"clock";
1255 static char __pyx_k_denom[] =
"denom";
1256 static char __pyx_k_drhom[] =
"drhom";
1257 static char __pyx_k_kr_eN[] =
"kr_eN";
1258 static char __pyx_k_matID[] =
"matID";
1259 static char __pyx_k_numer[] =
"numer";
1260 static char __pyx_k_numpy[] =
"numpy";
1261 static char __pyx_k_pcBar[] =
"pcBar";
1262 static char __pyx_k_q_dkr[] =
"q_dkr";
1263 static char __pyx_k_q_dmt[] =
"q_dmt";
1264 static char __pyx_k_range[] =
"range";
1265 static char __pyx_k_shape[] =
"shape";
1266 static char __pyx_k_u_dof[] =
"u_dof";
1267 static char __pyx_k_u_l2g[] =
"u_l2g";
1268 static char __pyx_k_vBar2[] =
"vBar2";
1269 static char __pyx_k_vol_e[] =
"vol_e";
1270 static char __pyx_k_zeros[] =
"zeros";
1271 static char __pyx_k_a_neig[] =
"a_neig";
1272 static char __pyx_k_colind[] =
"colind";
1273 static char __pyx_k_dkr_up[] =
"dkr_up";
1274 static char __pyx_k_import[] =
"__import__";
1275 static char __pyx_k_mt_avg[] =
"mt_avg";
1276 static char __pyx_k_nSpace[] =
"nSpace";
1277 static char __pyx_k_phi_eN[] =
"phi_eN";
1278 static char __pyx_k_picard[] =
"picard";
1279 static char __pyx_k_q_alin[] =
"q_alin";
1280 static char __pyx_k_q_detJ[] =
"q_detJ";
1281 static char __pyx_k_q_flin[] =
"q_flin";
1282 static char __pyx_k_q_mass[] =
"q_mass";
1283 static char __pyx_k_q_vals[] =
"q_vals";
1284 static char __pyx_k_rowptr[] =
"rowptr";
1285 static char __pyx_k_thetaR[] =
"thetaR";
1286 static char __pyx_k_thetaS[] =
"thetaS";
1287 static char __pyx_k_thetaW[] =
"thetaW";
1288 static char __pyx_k_u_neig[] =
"u_neig";
1289 static char __pyx_k_volume[] =
"volume";
1290 static char __pyx_k_weight[] =
"weight";
1291 static char __pyx_k_df_dofs[] =
"df_dofs";
1292 static char __pyx_k_eN_left[] =
"eN_left";
1293 static char __pyx_k_gravity[] =
"gravity";
1294 static char __pyx_k_kr_neig[] =
"kr_neig";
1295 static char __pyx_k_nSpace2[] =
"nSpace2";
1296 static char __pyx_k_omega_e[] =
"omega_e";
1297 static char __pyx_k_pcBar_n[] =
"pcBar_n";
1298 static char __pyx_k_q_dmass[] =
"q_dmass";
1299 static char __pyx_k_q_kr_up[] =
"q_kr_up";
1300 static char __pyx_k_thetaSR[] =
"thetaSR";
1301 static char __pyx_k_dmtj_avg[] =
"dmtj_avg";
1302 static char __pyx_k_eN_right[] =
"eN_right";
1303 static char __pyx_k_ebq_vals[] =
"ebq_vals";
1304 static char __pyx_k_integral[] =
"integral";
1305 static char __pyx_k_material[] =
"material";
1306 static char __pyx_k_phi_neig[] =
"phi_neig";
1307 static char __pyx_k_q_grad_u[] =
"q_grad_u";
1308 static char __pyx_k_q_grad_v[] =
"q_grad_v";
1309 static char __pyx_k_q_grad_w[] =
"q_grad_w";
1310 static char __pyx_k_ebN_local[] =
"ebN_local";
1311 static char __pyx_k_pcBar_nM1[] =
"pcBar_nM1";
1312 static char __pyx_k_pcBar_nM2[] =
"pcBar_nM2";
1313 static char __pyx_k_sqrt_sBar[] =
"sqrt_sBar";
1314 static char __pyx_k_transient[] =
"transient";
1315 static char __pyx_k_volFactor[] =
"volFactor";
1316 static char __pyx_k_zVelocity[] =
"zVelocity";
1317 static char __pyx_k_zvelocity[] =
"zvelocity";
1318 static char __pyx_k_DKWr_DpsiC[] =
"DKWr_DpsiC";
1319 static char __pyx_k_ValueError[] =
"ValueError";
1320 static char __pyx_k_matID_neig[] =
"matID_neig";
1321 static char __pyx_k_nAvgWeight[] =
"nAvgWeight";
1322 static char __pyx_k_upwindFlag[] =
"upwindFlag";
1323 static char __pyx_k_DsBar_DpsiC[] =
"DsBar_DpsiC";
1324 static char __pyx_k_DvBar_DpsiC[] =
"DvBar_DpsiC";
1325 static char __pyx_k_eN_neighbor[] =
"eN_neighbor";
1326 static char __pyx_k_RuntimeError[] =
"RuntimeError";
1327 static char __pyx_k_tForReversal[] =
"tForReversal";
1328 static char __pyx_k_DthetaW_DpsiC[] =
"DthetaW_DpsiC";
1329 static char __pyx_k_material_left[] =
"material_left";
1330 static char __pyx_k_weak_residual[] =
"weak_residual";
1331 static char __pyx_k_material_right[] =
"material_right";
1332 static char __pyx_k_ebq_global_vals[] =
"ebq_global_vals";
1333 static char __pyx_k_elementJacobian[] =
"elementJacobian";
1334 static char __pyx_k_elementResidual[] =
"elementResidual";
1335 static char __pyx_k_onePlus_pcBar_n[] =
"onePlus_pcBar_n";
1336 static char __pyx_k_nElements_global[] =
"nElements_global";
1337 static char __pyx_k_nDOF_test_element[] =
"nDOF_test_element";
1338 static char __pyx_k_material_functions[] =
"material_functions";
1339 static char __pyx_k_nDOF_trial_element[] =
"nDOF_trial_element";
1340 static char __pyx_k_updateMass_weakAvg[] =
"updateMass_weakAvg";
1341 static char __pyx_k_calculateNormalFlux[] =
"calculateNormalFlux";
1342 static char __pyx_k_thisElementIsUpwind[] =
"thisElementIsUpwind";
1343 static char __pyx_k_elementBoundaryTypes[] =
"elementBoundaryTypes";
1344 static char __pyx_k_elementMaterialTypes[] =
"elementMaterialTypes";
1345 static char __pyx_k_elementNeighborsArray[] =
"elementNeighborsArray";
1346 static char __pyx_k_elementBoundariesArray[] =
"elementBoundariesArray";
1347 static char __pyx_k_jacobian_weak_residual[] =
"jacobian_weak_residual";
1348 static char __pyx_k_characteristic_velocity[] =
"characteristic_velocity";
1349 static char __pyx_k_elementBarycentersArray[] =
"elementBarycentersArray";
1350 static char __pyx_k_nElementBoundaries_global[] =
"nElementBoundaries_global";
1351 static char __pyx_k_setElementBoundariesArray[] =
"setElementBoundariesArray";
1352 static char __pyx_k_RE_NCP1_getElementJacobian[] =
"RE_NCP1_getElementJacobian";
1353 static char __pyx_k_RE_NCP1_getElementResidual[] =
"RE_NCP1_getElementResidual";
1354 static char __pyx_k_nElementBoundaries_element[] =
"nElementBoundaries_element";
1355 static char __pyx_k_updateMassJacobian_weakAvg[] =
"updateMassJacobian_weakAvg";
1356 static char __pyx_k_vortexElementVelocityEval3[] =
"vortexElementVelocityEval3";
1357 static char __pyx_k_vortexElementVelocityEval4[] =
"vortexElementVelocityEval4";
1358 static char __pyx_k_helicalElementVelocityEval3[] =
"helicalElementVelocityEval3";
1359 static char __pyx_k_helicalElementVelocityEval4[] =
"helicalElementVelocityEval4";
1360 static char __pyx_k_ndarray_is_not_C_contiguous[] =
"ndarray is not C contiguous";
1361 static char __pyx_k_characteristic_velocity_dofs[] =
"characteristic_velocity_dofs";
1362 static char __pyx_k_elementBoundaryElementsArray[] =
"elementBoundaryElementsArray";
1363 static char __pyx_k_elementBoundaryMaterialTypes[] =
"elementBoundaryMaterialTypes";
1364 static char __pyx_k_subsurfaceTransportFunctions[] =
"subsurfaceTransportFunctions";
1365 static char __pyx_k_exteriorElementBoundariesArray[] =
"exteriorElementBoundariesArray";
1366 static char __pyx_k_home_cekees_proteus_proteus_sub[] =
"/home/cekees/proteus/proteus/subsurfaceTransportFunctions.pyx";
1367 static char __pyx_k_setExteriorElementBoundaryTypes[] =
"setExteriorElementBoundaryTypes";
1368 static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] =
"unknown dtype code in numpy.pxd (%d)";
1369 static char __pyx_k_Format_string_allocated_too_shor[] =
"Format string allocated too short, see comment in numpy.pxd";
1370 static char __pyx_k_Non_native_byte_order_not_suppor[] =
"Non-native byte order not supported";
1371 static char __pyx_k_RE_NCP1_evaluateElementCoefficie[] =
"RE_NCP1_evaluateElementCoefficients_Linear";
1372 static char __pyx_k_computeSimpleCharacteristicVeloc[] =
"computeSimpleCharacteristicVelocityFromElementVelocity";
1373 static char __pyx_k_evaluateScalarMaterialFunctionOv[] =
"evaluateScalarMaterialFunctionOverElements";
1374 static char __pyx_k_evaluateSparseTensorMaterialFunc[] =
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1375 static char __pyx_k_evaluateVectorMaterialFunctionOv[] =
"evaluateVectorMaterialFunctionOverElements";
1376 static char __pyx_k_exteriorElementBoundaryMaterialT[] =
"exteriorElementBoundaryMaterialTypes";
1377 static char __pyx_k_nExteriorElementBoundaries_globa[] =
"nExteriorElementBoundaries_global";
1378 static char __pyx_k_ndarray_is_not_Fortran_contiguou[] =
"ndarray is not Fortran contiguous";
1379 static char __pyx_k_rotatingGaussianElementVelocityE[] =
"rotatingGaussianElementVelocityEval3";
1380 static char __pyx_k_setScalarMaterialFunctionOverEle[] =
"setScalarMaterialFunctionOverElements";
1381 static char __pyx_k_setScalarMaterialFunctionOverGlo[] =
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1382 static char __pyx_k_setSparseTensorMaterialFunctionO[] =
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage";
1383 static char __pyx_k_setVectorMaterialFunctionOverEle[] =
"setVectorMaterialFunctionOverElements";
1384 static char __pyx_k_Format_string_allocated_too_shor_2[] =
"Format string allocated too short.";
1385 static char __pyx_k_RE_NCP1_evaluateElementCoefficie_2[] =
"RE_NCP1_evaluateElementCoefficients_VGM";
1386 static char __pyx_k_computeSimpleCharacteristicVeloc_2[] =
"computeSimpleCharacteristicVelocityFromVelocityDOFs";
1387 static char __pyx_k_evaluateScalarMaterialFunctionOv_2[] =
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1388 static char __pyx_k_evaluateScalarMaterialFunctionOv_3[] =
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage";
1389 static char __pyx_k_evaluateSparseTensorMaterialFunc_2[] =
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1390 static char __pyx_k_rotatingGaussianElementVelocityE_2[] =
"rotatingGaussianElementVelocityEval4";
1391 static char __pyx_k_setScalarMaterialFunctionOverEle_2[] =
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage";
1392 static char __pyx_k_setSparseTensorMaterialFunctionO_2[] =
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage";
1393 static PyObject *__pyx_n_s_DKWr_DpsiC;
1394 static PyObject *__pyx_n_s_DsBar_DpsiC;
1395 static PyObject *__pyx_n_s_DthetaW_DpsiC;
1396 static PyObject *__pyx_n_s_DvBar_DpsiC;
1397 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
1398 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
1399 static PyObject *__pyx_n_s_I;
1400 static PyObject *__pyx_n_s_J;
1401 static PyObject *__pyx_n_s_KWr;
1402 static PyObject *__pyx_n_s_KWs;
1403 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
1404 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie;
1405 static PyObject *__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2;
1406 static PyObject *__pyx_n_s_RE_NCP1_getElementJacobian;
1407 static PyObject *__pyx_n_s_RE_NCP1_getElementResidual;
1408 static PyObject *__pyx_n_s_RuntimeError;
1409 static PyObject *__pyx_n_s_ValueError;
1410 static PyObject *__pyx_n_s_a_avg;
1411 static PyObject *__pyx_n_s_a_eN;
1412 static PyObject *__pyx_n_s_a_neig;
1413 static PyObject *__pyx_n_s_a_up;
1414 static PyObject *__pyx_n_s_alpha;
1415 static PyObject *__pyx_n_s_beta;
1416 static PyObject *__pyx_n_s_calculateNormalFlux;
1417 static PyObject *__pyx_n_s_characteristic_velocity;
1418 static PyObject *__pyx_n_s_characteristic_velocity_dofs;
1419 static PyObject *__pyx_n_s_clock;
1420 static PyObject *__pyx_n_s_colind;
1421 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc;
1422 static PyObject *__pyx_n_s_computeSimpleCharacteristicVeloc_2;
1423 static PyObject *__pyx_n_s_d;
1424 static PyObject *__pyx_n_s_dS;
1425 static PyObject *__pyx_n_s_dV;
1426 static PyObject *__pyx_n_s_denom;
1427 static PyObject *__pyx_n_s_df;
1428 static PyObject *__pyx_n_s_df_dofs;
1429 static PyObject *__pyx_n_s_dkr_up;
1430 static PyObject *__pyx_n_s_dm;
1431 static PyObject *__pyx_n_s_dmt;
1432 static PyObject *__pyx_n_s_dmtj_avg;
1433 static PyObject *__pyx_n_s_dot;
1434 static PyObject *__pyx_n_s_drhom;
1435 static PyObject *__pyx_n_s_eN;
1436 static PyObject *__pyx_n_s_eN_left;
1437 static PyObject *__pyx_n_s_eN_neighbor;
1438 static PyObject *__pyx_n_s_eN_right;
1439 static PyObject *__pyx_n_s_ebN;
1440 static PyObject *__pyx_n_s_ebNE;
1441 static PyObject *__pyx_n_s_ebN_local;
1442 static PyObject *__pyx_n_s_ebq_global_vals;
1443 static PyObject *__pyx_n_s_ebq_vals;
1444 static PyObject *__pyx_n_s_elementBarycentersArray;
1445 static PyObject *__pyx_n_s_elementBoundariesArray;
1446 static PyObject *__pyx_n_s_elementBoundaryElementsArray;
1447 static PyObject *__pyx_n_s_elementBoundaryMaterialTypes;
1448 static PyObject *__pyx_n_s_elementBoundaryTypes;
1449 static PyObject *__pyx_n_s_elementJacobian;
1450 static PyObject *__pyx_n_s_elementMaterialTypes;
1451 static PyObject *__pyx_n_s_elementNeighborsArray;
1452 static PyObject *__pyx_n_s_elementResidual;
1453 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv;
1454 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_2;
1455 static PyObject *__pyx_n_s_evaluateScalarMaterialFunctionOv_3;
1456 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc;
1457 static PyObject *__pyx_n_s_evaluateSparseTensorMaterialFunc_2;
1458 static PyObject *__pyx_n_s_evaluateVectorMaterialFunctionOv;
1459 static PyObject *__pyx_n_s_exteriorElementBoundariesArray;
1460 static PyObject *__pyx_n_s_exteriorElementBoundaryMaterialT;
1461 static PyObject *__pyx_n_s_f_up;
1462 static PyObject *__pyx_n_s_flat;
1463 static PyObject *__pyx_n_s_flux;
1464 static PyObject *__pyx_n_s_gravity;
1465 static PyObject *__pyx_n_s_helicalElementVelocityEval3;
1466 static PyObject *__pyx_n_s_helicalElementVelocityEval4;
1467 static PyObject *__pyx_kp_s_home_cekees_proteus_proteus_sub;
1468 static PyObject *__pyx_n_s_i;
1469 static PyObject *__pyx_n_s_ii;
1470 static PyObject *__pyx_n_s_import;
1471 static PyObject *__pyx_n_s_integral;
1472 static PyObject *__pyx_n_s_j;
1473 static PyObject *__pyx_n_s_jacobian_weak_residual;
1474 static PyObject *__pyx_n_s_k;
1475 static PyObject *__pyx_n_s_kb;
1476 static PyObject *__pyx_n_s_kr_eN;
1477 static PyObject *__pyx_n_s_kr_neig;
1478 static PyObject *__pyx_n_s_l2g;
1479 static PyObject *__pyx_n_s_m;
1480 static PyObject *__pyx_n_s_main;
1481 static PyObject *__pyx_n_s_matID;
1482 static PyObject *__pyx_n_s_matID_neig;
1483 static PyObject *__pyx_n_s_material;
1484 static PyObject *__pyx_n_s_material_functions;
1485 static PyObject *__pyx_n_s_material_left;
1486 static PyObject *__pyx_n_s_material_right;
1487 static PyObject *__pyx_n_s_mt;
1488 static PyObject *__pyx_n_s_mt_avg;
1489 static PyObject *__pyx_n_s_n;
1490 static PyObject *__pyx_n_s_nAvgWeight;
1491 static PyObject *__pyx_n_s_nDOF_test_element;
1492 static PyObject *__pyx_n_s_nDOF_trial_element;
1493 static PyObject *__pyx_n_s_nElementBoundaries_element;
1494 static PyObject *__pyx_n_s_nElementBoundaries_global;
1495 static PyObject *__pyx_n_s_nElements_global;
1496 static PyObject *__pyx_n_s_nExteriorElementBoundaries_globa;
1497 static PyObject *__pyx_n_s_nSpace;
1498 static PyObject *__pyx_n_s_nSpace2;
1499 static PyObject *__pyx_n_s_nd;
1500 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
1501 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
1502 static PyObject *__pyx_n_s_nnz;
1503 static PyObject *__pyx_n_s_numer;
1504 static PyObject *__pyx_n_s_numpy;
1505 static PyObject *__pyx_n_s_omega_e;
1506 static PyObject *__pyx_n_s_one8;
1507 static PyObject *__pyx_n_s_onePlus_pcBar_n;
1508 static PyObject *__pyx_n_s_pcBar;
1509 static PyObject *__pyx_n_s_pcBar_n;
1510 static PyObject *__pyx_n_s_pcBar_nM1;
1511 static PyObject *__pyx_n_s_pcBar_nM2;
1512 static PyObject *__pyx_n_s_phi_eN;
1513 static PyObject *__pyx_n_s_phi_neig;
1514 static PyObject *__pyx_n_s_pi;
1515 static PyObject *__pyx_n_s_picard;
1516 static PyObject *__pyx_n_s_psiC;
1517 static PyObject *__pyx_n_s_q;
1518 static PyObject *__pyx_n_s_q_alin;
1519 static PyObject *__pyx_n_s_q_detJ;
1520 static PyObject *__pyx_n_s_q_dkr;
1521 static PyObject *__pyx_n_s_q_dm;
1522 static PyObject *__pyx_n_s_q_dmass;
1523 static PyObject *__pyx_n_s_q_dmt;
1524 static PyObject *__pyx_n_s_q_flin;
1525 static PyObject *__pyx_n_s_q_grad_u;
1526 static PyObject *__pyx_n_s_q_grad_v;
1527 static PyObject *__pyx_n_s_q_grad_w;
1528 static PyObject *__pyx_n_s_q_kr;
1529 static PyObject *__pyx_n_s_q_kr_up;
1530 static PyObject *__pyx_n_s_q_m;
1531 static PyObject *__pyx_n_s_q_mass;
1532 static PyObject *__pyx_n_s_q_mt;
1533 static PyObject *__pyx_n_s_q_r;
1534 static PyObject *__pyx_n_s_q_u;
1535 static PyObject *__pyx_n_s_q_vals;
1536 static PyObject *__pyx_n_s_q_x;
1537 static PyObject *__pyx_n_s_range;
1538 static PyObject *__pyx_n_s_rho;
1539 static PyObject *__pyx_n_s_rho2;
1540 static PyObject *__pyx_n_s_rhom;
1541 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE;
1542 static PyObject *__pyx_n_s_rotatingGaussianElementVelocityE_2;
1543 static PyObject *__pyx_n_s_rowptr;
1544 static PyObject *__pyx_n_s_sBar;
1545 static PyObject *__pyx_n_s_setElementBoundariesArray;
1546 static PyObject *__pyx_n_s_setExteriorElementBoundaryTypes;
1547 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle;
1548 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverEle_2;
1549 static PyObject *__pyx_n_s_setScalarMaterialFunctionOverGlo;
1550 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO;
1551 static PyObject *__pyx_n_s_setSparseTensorMaterialFunctionO_2;
1552 static PyObject *__pyx_n_s_setVectorMaterialFunctionOverEle;
1553 static PyObject *__pyx_n_s_shape;
1554 static PyObject *__pyx_n_s_sqrt_sBar;
1555 static PyObject *__pyx_n_s_subsurfaceTransportFunctions;
1556 static PyObject *__pyx_n_s_sum;
1557 static PyObject *__pyx_n_s_t;
1558 static PyObject *__pyx_n_s_tForReversal;
1559 static PyObject *__pyx_n_s_test;
1560 static PyObject *__pyx_n_s_thetaR;
1561 static PyObject *__pyx_n_s_thetaS;
1562 static PyObject *__pyx_n_s_thetaSR;
1563 static PyObject *__pyx_n_s_thetaW;
1564 static PyObject *__pyx_n_s_thisElementIsUpwind;
1565 static PyObject *__pyx_n_s_transient;
1566 static PyObject *__pyx_n_s_u_dof;
1567 static PyObject *__pyx_n_s_u_eN;
1568 static PyObject *__pyx_n_s_u_j;
1569 static PyObject *__pyx_n_s_u_l2g;
1570 static PyObject *__pyx_n_s_u_neig;
1571 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
1572 static PyObject *__pyx_n_s_updateMassJacobian_weakAvg;
1573 static PyObject *__pyx_n_s_updateMass_weakAvg;
1574 static PyObject *__pyx_n_s_upwindFlag;
1575 static PyObject *__pyx_n_s_v;
1576 static PyObject *__pyx_n_s_vBar;
1577 static PyObject *__pyx_n_s_vBar2;
1578 static PyObject *__pyx_n_s_vol;
1579 static PyObject *__pyx_n_s_volFactor;
1580 static PyObject *__pyx_n_s_vol_e;
1581 static PyObject *__pyx_n_s_volume;
1582 static PyObject *__pyx_n_s_vortexElementVelocityEval3;
1583 static PyObject *__pyx_n_s_vortexElementVelocityEval4;
1584 static PyObject *__pyx_n_s_w;
1585 static PyObject *__pyx_n_s_weak_residual;
1586 static PyObject *__pyx_n_s_weight;
1587 static PyObject *__pyx_n_s_x;
1588 static PyObject *__pyx_n_s_xc;
1589 static PyObject *__pyx_n_s_yc;
1590 static PyObject *__pyx_n_s_zVelocity;
1591 static PyObject *__pyx_n_s_zeros;
1592 static PyObject *__pyx_n_s_zvelocity;
1593 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes);
1594 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes);
1595 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1596 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1597 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1598 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1599 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1600 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1601 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1602 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions);
1603 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1604 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions);
1605 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1606 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions);
1607 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin);
1608 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up);
1609 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual);
1610 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian);
1611 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual);
1612 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual);
1613 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux);
1614 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
1615 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV);
1616 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
1617 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity);
1618 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1619 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1620 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1621 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v);
1622 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
1623 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info);
1624 static PyObject *__pyx_float_0_0;
1625 static PyObject *__pyx_float_0_5;
1626 static PyObject *__pyx_float_2_0;
1627 static PyObject *__pyx_float_1_0eneg_20;
1628 static PyObject *__pyx_slice_;
1629 static PyObject *__pyx_slice__2;
1630 static PyObject *__pyx_slice__3;
1631 static PyObject *__pyx_slice__4;
1632 static PyObject *__pyx_slice__5;
1633 static PyObject *__pyx_slice__6;
1634 static PyObject *__pyx_slice__7;
1635 static PyObject *__pyx_slice__8;
1636 static PyObject *__pyx_tuple__9;
1637 static PyObject *__pyx_tuple__10;
1638 static PyObject *__pyx_tuple__11;
1639 static PyObject *__pyx_tuple__12;
1640 static PyObject *__pyx_tuple__13;
1641 static PyObject *__pyx_tuple__14;
1642 static PyObject *__pyx_tuple__15;
1643 static PyObject *__pyx_tuple__17;
1644 static PyObject *__pyx_tuple__19;
1645 static PyObject *__pyx_tuple__21;
1646 static PyObject *__pyx_tuple__23;
1647 static PyObject *__pyx_tuple__25;
1648 static PyObject *__pyx_tuple__27;
1649 static PyObject *__pyx_tuple__29;
1650 static PyObject *__pyx_tuple__31;
1651 static PyObject *__pyx_tuple__33;
1652 static PyObject *__pyx_tuple__35;
1653 static PyObject *__pyx_tuple__37;
1654 static PyObject *__pyx_tuple__39;
1655 static PyObject *__pyx_tuple__41;
1656 static PyObject *__pyx_tuple__43;
1657 static PyObject *__pyx_tuple__45;
1658 static PyObject *__pyx_tuple__47;
1659 static PyObject *__pyx_tuple__49;
1660 static PyObject *__pyx_tuple__51;
1661 static PyObject *__pyx_tuple__53;
1662 static PyObject *__pyx_tuple__55;
1663 static PyObject *__pyx_tuple__57;
1664 static PyObject *__pyx_tuple__59;
1665 static PyObject *__pyx_tuple__61;
1666 static PyObject *__pyx_tuple__63;
1667 static PyObject *__pyx_tuple__65;
1668 static PyObject *__pyx_tuple__67;
1669 static PyObject *__pyx_tuple__69;
1670 static PyObject *__pyx_tuple__71;
1671 static PyObject *__pyx_codeobj__16;
1672 static PyObject *__pyx_codeobj__18;
1673 static PyObject *__pyx_codeobj__20;
1674 static PyObject *__pyx_codeobj__22;
1675 static PyObject *__pyx_codeobj__24;
1676 static PyObject *__pyx_codeobj__26;
1677 static PyObject *__pyx_codeobj__28;
1678 static PyObject *__pyx_codeobj__30;
1679 static PyObject *__pyx_codeobj__32;
1680 static PyObject *__pyx_codeobj__34;
1681 static PyObject *__pyx_codeobj__36;
1682 static PyObject *__pyx_codeobj__38;
1683 static PyObject *__pyx_codeobj__40;
1684 static PyObject *__pyx_codeobj__42;
1685 static PyObject *__pyx_codeobj__44;
1686 static PyObject *__pyx_codeobj__46;
1687 static PyObject *__pyx_codeobj__48;
1688 static PyObject *__pyx_codeobj__50;
1689 static PyObject *__pyx_codeobj__52;
1690 static PyObject *__pyx_codeobj__54;
1691 static PyObject *__pyx_codeobj__56;
1692 static PyObject *__pyx_codeobj__58;
1693 static PyObject *__pyx_codeobj__60;
1694 static PyObject *__pyx_codeobj__62;
1695 static PyObject *__pyx_codeobj__64;
1696 static PyObject *__pyx_codeobj__66;
1697 static PyObject *__pyx_codeobj__68;
1698 static PyObject *__pyx_codeobj__70;
1699 static PyObject *__pyx_codeobj__72;
1709 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_max(
double __pyx_v_a,
double __pyx_v_b) {
1711 __Pyx_RefNannyDeclarations
1713 __Pyx_RefNannySetupContext(
"double_max", 0);
1714 if (((__pyx_v_a >= __pyx_v_b) != 0)) {
1715 __pyx_t_1 = __pyx_v_a;
1717 __pyx_t_1 = __pyx_v_b;
1719 __pyx_r = __pyx_t_1;
1724 __Pyx_RefNannyFinishContext();
1736 static CYTHON_INLINE
double __pyx_f_28subsurfaceTransportFunctions_double_min(
double __pyx_v_a,
double __pyx_v_b) {
1738 __Pyx_RefNannyDeclarations
1740 __Pyx_RefNannySetupContext(
"double_min", 0);
1741 if (((__pyx_v_a <= __pyx_v_b) != 0)) {
1742 __pyx_t_1 = __pyx_v_a;
1744 __pyx_t_1 = __pyx_v_b;
1746 __pyx_r = __pyx_t_1;
1751 __Pyx_RefNannyFinishContext();
1764 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
1765 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes = {
"setExteriorElementBoundaryTypes", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, METH_VARARGS|METH_KEYWORDS, 0};
1766 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
1767 int __pyx_v_nExteriorElementBoundaries_global;
1768 PyArrayObject *__pyx_v_exteriorElementBoundariesArray = 0;
1769 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
1770 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
1771 PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes = 0;
1772 int __pyx_lineno = 0;
1773 const char *__pyx_filename = NULL;
1774 int __pyx_clineno = 0;
1775 PyObject *__pyx_r = 0;
1776 __Pyx_RefNannyDeclarations
1777 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes (wrapper)", 0);
1779 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nExteriorElementBoundaries_globa,&__pyx_n_s_exteriorElementBoundariesArray,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_exteriorElementBoundaryMaterialT,0};
1780 PyObject* values[5] = {0,0,0,0,0};
1781 if (unlikely(__pyx_kwds)) {
1783 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
1785 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1786 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1787 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1788 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1789 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1791 default:
goto __pyx_L5_argtuple_error;
1793 kw_args = PyDict_Size(__pyx_kwds);
1796 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nExteriorElementBoundaries_globa)) != 0)) kw_args--;
1797 else goto __pyx_L5_argtuple_error;
1799 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exteriorElementBoundariesArray)) != 0)) kw_args--;
1801 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1804 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
1806 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1809 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
1811 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1814 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_exteriorElementBoundaryMaterialT)) != 0)) kw_args--;
1816 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1819 if (unlikely(kw_args > 0)) {
1820 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setExteriorElementBoundaryTypes") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1822 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
1823 goto __pyx_L5_argtuple_error;
1825 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
1826 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
1827 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
1828 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
1829 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
1831 __pyx_v_nExteriorElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nExteriorElementBoundaries_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1832 __pyx_v_exteriorElementBoundariesArray = ((PyArrayObject *)values[1]);
1833 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[2]);
1834 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[3]);
1835 __pyx_v_exteriorElementBoundaryMaterialTypes = ((PyArrayObject *)values[4]);
1837 goto __pyx_L4_argument_unpacking_done;
1838 __pyx_L5_argtuple_error:;
1839 __Pyx_RaiseArgtupleInvalid(
"setExteriorElementBoundaryTypes", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
1841 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
1842 __Pyx_RefNannyFinishContext();
1844 __pyx_L4_argument_unpacking_done:;
1845 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 19; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1846 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 20; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1847 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 21; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1848 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_exteriorElementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"exteriorElementBoundaryMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 22; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1849 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(__pyx_self, __pyx_v_nExteriorElementBoundaries_global, __pyx_v_exteriorElementBoundariesArray, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_exteriorElementBoundaryMaterialTypes);
1856 __Pyx_RefNannyFinishContext();
1860 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_setExteriorElementBoundaryTypes(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nExteriorElementBoundaries_global, PyArrayObject *__pyx_v_exteriorElementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_exteriorElementBoundaryMaterialTypes) {
1864 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
1865 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
1866 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
1867 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
1868 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundariesArray;
1869 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundariesArray;
1870 __Pyx_LocalBuf_ND __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes;
1871 __Pyx_Buffer __pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
1872 PyObject *__pyx_r = NULL;
1873 __Pyx_RefNannyDeclarations
1876 Py_ssize_t __pyx_t_3;
1878 Py_ssize_t __pyx_t_5;
1879 Py_ssize_t __pyx_t_6;
1880 Py_ssize_t __pyx_t_7;
1881 Py_ssize_t __pyx_t_8;
1882 int __pyx_lineno = 0;
1883 const char *__pyx_filename = NULL;
1884 int __pyx_clineno = 0;
1885 __Pyx_RefNannySetupContext(
"setExteriorElementBoundaryTypes", 0);
1886 __pyx_pybuffer_exteriorElementBoundariesArray.pybuffer.buf = NULL;
1887 __pyx_pybuffer_exteriorElementBoundariesArray.refcount = 0;
1888 __pyx_pybuffernd_exteriorElementBoundariesArray.data = NULL;
1889 __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer = &__pyx_pybuffer_exteriorElementBoundariesArray;
1890 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
1891 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
1892 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
1893 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
1894 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
1895 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
1896 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
1897 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
1898 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.pybuffer.buf = NULL;
1899 __pyx_pybuffer_exteriorElementBoundaryMaterialTypes.refcount = 0;
1900 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.data = NULL;
1901 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_exteriorElementBoundaryMaterialTypes;
1903 __Pyx_BufFmt_StackElem __pyx_stack[1];
1904 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1906 __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.shape[0];
1908 __Pyx_BufFmt_StackElem __pyx_stack[1];
1909 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1911 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
1913 __Pyx_BufFmt_StackElem __pyx_stack[1];
1914 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1916 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
1918 __Pyx_BufFmt_StackElem __pyx_stack[1];
1919 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_exteriorElementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1921 __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0];
1930 __pyx_t_1 = __pyx_v_nExteriorElementBoundaries_global;
1931 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
1932 __pyx_v_ebNE = __pyx_t_2;
1941 __pyx_t_3 = __pyx_v_ebNE;
1943 if (__pyx_t_3 < 0) {
1944 __pyx_t_3 += __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape;
1945 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
1946 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].shape)) __pyx_t_4 = 0;
1947 if (unlikely(__pyx_t_4 != -1)) {
1948 __Pyx_RaiseBufferIndexError(__pyx_t_4);
1949 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 25; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1951 __pyx_v_ebN = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_exteriorElementBoundariesArray.diminfo[0].strides));
1960 __pyx_t_5 = __pyx_v_ebN;
1963 if (__pyx_t_5 < 0) {
1964 __pyx_t_5 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
1965 if (unlikely(__pyx_t_5 < 0)) __pyx_t_4 = 0;
1966 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_4 = 0;
1967 if (__pyx_t_6 < 0) {
1968 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
1969 if (unlikely(__pyx_t_6 < 0)) __pyx_t_4 = 1;
1970 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_4 = 1;
1971 if (unlikely(__pyx_t_4 != -1)) {
1972 __Pyx_RaiseBufferIndexError(__pyx_t_4);
1973 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 26; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1975 __pyx_v_eN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
1984 __pyx_t_7 = __pyx_v_eN;
1986 if (__pyx_t_7 < 0) {
1987 __pyx_t_7 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
1988 if (unlikely(__pyx_t_7 < 0)) __pyx_t_4 = 0;
1989 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
1990 if (unlikely(__pyx_t_4 != -1)) {
1991 __Pyx_RaiseBufferIndexError(__pyx_t_4);
1992 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
1994 __pyx_t_8 = __pyx_v_ebNE;
1996 if (__pyx_t_8 < 0) {
1997 __pyx_t_8 += __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape;
1998 if (unlikely(__pyx_t_8 < 0)) __pyx_t_4 = 0;
1999 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2000 if (unlikely(__pyx_t_4 != -1)) {
2001 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2002 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 27; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2004 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2016 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2019 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2020 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2021 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2022 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2023 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2024 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2025 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2026 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setExteriorElementBoundaryTypes", __pyx_clineno, __pyx_lineno, __pyx_filename);
2030 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2031 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2032 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundariesArray.rcbuffer->pybuffer);
2033 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_exteriorElementBoundaryMaterialTypes.rcbuffer->pybuffer);
2035 __Pyx_XGIVEREF(__pyx_r);
2036 __Pyx_RefNannyFinishContext();
2049 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2050 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray = {
"setElementBoundariesArray", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray, METH_VARARGS|METH_KEYWORDS, 0};
2051 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_3setElementBoundariesArray(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2052 int __pyx_v_nElementBoundaries_global;
2053 PyArrayObject *__pyx_v_elementBoundaryElementsArray = 0;
2054 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2055 PyArrayObject *__pyx_v_elementBoundaryMaterialTypes = 0;
2056 int __pyx_lineno = 0;
2057 const char *__pyx_filename = NULL;
2058 int __pyx_clineno = 0;
2059 PyObject *__pyx_r = 0;
2060 __Pyx_RefNannyDeclarations
2061 __Pyx_RefNannySetupContext(
"setElementBoundariesArray (wrapper)", 0);
2063 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nElementBoundaries_global,&__pyx_n_s_elementBoundaryElementsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_elementBoundaryMaterialTypes,0};
2064 PyObject* values[4] = {0,0,0,0};
2065 if (unlikely(__pyx_kwds)) {
2067 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2069 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2070 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2071 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2072 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2074 default:
goto __pyx_L5_argtuple_error;
2076 kw_args = PyDict_Size(__pyx_kwds);
2079 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_global)) != 0)) kw_args--;
2080 else goto __pyx_L5_argtuple_error;
2082 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryElementsArray)) != 0)) kw_args--;
2084 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2087 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2089 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2092 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryMaterialTypes)) != 0)) kw_args--;
2094 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2097 if (unlikely(kw_args > 0)) {
2098 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setElementBoundariesArray") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2100 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2101 goto __pyx_L5_argtuple_error;
2103 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2104 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2105 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2106 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2108 __pyx_v_nElementBoundaries_global = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nElementBoundaries_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2109 __pyx_v_elementBoundaryElementsArray = ((PyArrayObject *)values[1]);
2110 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[2]);
2111 __pyx_v_elementBoundaryMaterialTypes = ((PyArrayObject *)values[3]);
2113 goto __pyx_L4_argument_unpacking_done;
2114 __pyx_L5_argtuple_error:;
2115 __Pyx_RaiseArgtupleInvalid(
"setElementBoundariesArray", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2117 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2118 __Pyx_RefNannyFinishContext();
2120 __pyx_L4_argument_unpacking_done:;
2121 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryElementsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryElementsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2122 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2123 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2124 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(__pyx_self, __pyx_v_nElementBoundaries_global, __pyx_v_elementBoundaryElementsArray, __pyx_v_elementMaterialTypes, __pyx_v_elementBoundaryMaterialTypes);
2131 __Pyx_RefNannyFinishContext();
2135 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_2setElementBoundariesArray(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nElementBoundaries_global, PyArrayObject *__pyx_v_elementBoundaryElementsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_elementBoundaryMaterialTypes) {
2137 int __pyx_v_eN_left;
2138 int __pyx_v_eN_right;
2139 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryElementsArray;
2140 __Pyx_Buffer __pyx_pybuffer_elementBoundaryElementsArray;
2141 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryMaterialTypes;
2142 __Pyx_Buffer __pyx_pybuffer_elementBoundaryMaterialTypes;
2143 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2144 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2145 PyObject *__pyx_r = NULL;
2146 __Pyx_RefNannyDeclarations
2149 Py_ssize_t __pyx_t_3;
2150 Py_ssize_t __pyx_t_4;
2152 Py_ssize_t __pyx_t_6;
2153 Py_ssize_t __pyx_t_7;
2154 Py_ssize_t __pyx_t_8;
2155 Py_ssize_t __pyx_t_9;
2156 Py_ssize_t __pyx_t_10;
2157 Py_ssize_t __pyx_t_11;
2158 Py_ssize_t __pyx_t_12;
2159 Py_ssize_t __pyx_t_13;
2161 Py_ssize_t __pyx_t_15;
2162 Py_ssize_t __pyx_t_16;
2163 Py_ssize_t __pyx_t_17;
2164 int __pyx_lineno = 0;
2165 const char *__pyx_filename = NULL;
2166 int __pyx_clineno = 0;
2167 __Pyx_RefNannySetupContext(
"setElementBoundariesArray", 0);
2168 __pyx_pybuffer_elementBoundaryElementsArray.pybuffer.buf = NULL;
2169 __pyx_pybuffer_elementBoundaryElementsArray.refcount = 0;
2170 __pyx_pybuffernd_elementBoundaryElementsArray.data = NULL;
2171 __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer = &__pyx_pybuffer_elementBoundaryElementsArray;
2172 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2173 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2174 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2175 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2176 __pyx_pybuffer_elementBoundaryMaterialTypes.pybuffer.buf = NULL;
2177 __pyx_pybuffer_elementBoundaryMaterialTypes.refcount = 0;
2178 __pyx_pybuffernd_elementBoundaryMaterialTypes.data = NULL;
2179 __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryMaterialTypes;
2181 __Pyx_BufFmt_StackElem __pyx_stack[1];
2182 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryElementsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2184 __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.shape[1];
2186 __Pyx_BufFmt_StackElem __pyx_stack[1];
2187 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2189 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2191 __Pyx_BufFmt_StackElem __pyx_stack[1];
2192 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2194 __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.shape[1];
2203 __pyx_t_1 = __pyx_v_nElementBoundaries_global;
2204 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2205 __pyx_v_ebN = __pyx_t_2;
2214 __pyx_t_3 = __pyx_v_ebN;
2217 if (__pyx_t_3 < 0) {
2218 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2219 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
2220 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2221 if (__pyx_t_4 < 0) {
2222 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2223 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
2224 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2225 if (unlikely(__pyx_t_5 != -1)) {
2226 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2227 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2229 __pyx_v_eN_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2238 __pyx_t_6 = __pyx_v_ebN;
2241 if (__pyx_t_6 < 0) {
2242 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape;
2243 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
2244 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].shape)) __pyx_t_5 = 0;
2245 if (__pyx_t_7 < 0) {
2246 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape;
2247 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
2248 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].shape)) __pyx_t_5 = 1;
2249 if (unlikely(__pyx_t_5 != -1)) {
2250 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2251 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2253 __pyx_v_eN_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryElementsArray.diminfo[1].strides));
2262 __pyx_t_8 = __pyx_v_eN_left;
2264 if (__pyx_t_8 < 0) {
2265 __pyx_t_8 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2266 if (unlikely(__pyx_t_8 < 0)) __pyx_t_5 = 0;
2267 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2268 if (unlikely(__pyx_t_5 != -1)) {
2269 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2270 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2272 __pyx_t_9 = __pyx_v_ebN;
2275 if (__pyx_t_9 < 0) {
2276 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2277 if (unlikely(__pyx_t_9 < 0)) __pyx_t_5 = 0;
2278 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2279 if (__pyx_t_10 < 0) {
2280 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2281 if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 1;
2282 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2283 if (unlikely(__pyx_t_5 != -1)) {
2284 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2285 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2287 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2296 __pyx_t_11 = __pyx_v_eN_left;
2298 if (__pyx_t_11 < 0) {
2299 __pyx_t_11 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2300 if (unlikely(__pyx_t_11 < 0)) __pyx_t_5 = 0;
2301 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2302 if (unlikely(__pyx_t_5 != -1)) {
2303 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2304 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2306 __pyx_t_12 = __pyx_v_ebN;
2309 if (__pyx_t_12 < 0) {
2310 __pyx_t_12 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2311 if (unlikely(__pyx_t_12 < 0)) __pyx_t_5 = 0;
2312 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2313 if (__pyx_t_13 < 0) {
2314 __pyx_t_13 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2315 if (unlikely(__pyx_t_13 < 0)) __pyx_t_5 = 1;
2316 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2317 if (unlikely(__pyx_t_5 != -1)) {
2318 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2319 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 38; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2321 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2330 __pyx_t_14 = ((__pyx_v_eN_right >= 0) != 0);
2340 __pyx_t_15 = __pyx_v_eN_right;
2342 if (__pyx_t_15 < 0) {
2343 __pyx_t_15 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2344 if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 0;
2345 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2346 if (unlikely(__pyx_t_5 != -1)) {
2347 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2348 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2350 __pyx_t_16 = __pyx_v_ebN;
2353 if (__pyx_t_16 < 0) {
2354 __pyx_t_16 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape;
2355 if (unlikely(__pyx_t_16 < 0)) __pyx_t_5 = 0;
2356 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].shape)) __pyx_t_5 = 0;
2357 if (__pyx_t_17 < 0) {
2358 __pyx_t_17 += __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape;
2359 if (unlikely(__pyx_t_17 < 0)) __pyx_t_5 = 1;
2360 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].shape)) __pyx_t_5 = 1;
2361 if (unlikely(__pyx_t_5 != -1)) {
2362 __Pyx_RaiseBufferIndexError(__pyx_t_5);
2363 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2365 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_elementBoundaryMaterialTypes.diminfo[1].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2386 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2389 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2390 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2391 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2392 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2393 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2394 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2395 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setElementBoundariesArray", __pyx_clineno, __pyx_lineno, __pyx_filename);
2399 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryElementsArray.rcbuffer->pybuffer);
2400 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryMaterialTypes.rcbuffer->pybuffer);
2401 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2403 __Pyx_XGIVEREF(__pyx_r);
2404 __Pyx_RefNannyFinishContext();
2417 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2418 static char __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and set is material j\n likely little improvement right now without correct typing of material_functions\n ";
2419 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements = {
"setScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements};
2420 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2421 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2422 PyArrayObject *__pyx_v_q_vals = 0;
2423 PyObject *__pyx_v_material_functions = 0;
2424 int __pyx_lineno = 0;
2425 const char *__pyx_filename = NULL;
2426 int __pyx_clineno = 0;
2427 PyObject *__pyx_r = 0;
2428 __Pyx_RefNannyDeclarations
2429 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements (wrapper)", 0);
2431 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2432 PyObject* values[3] = {0,0,0};
2433 if (unlikely(__pyx_kwds)) {
2435 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2437 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2438 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2439 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2441 default:
goto __pyx_L5_argtuple_error;
2443 kw_args = PyDict_Size(__pyx_kwds);
2446 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2447 else goto __pyx_L5_argtuple_error;
2449 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
2451 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2454 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2456 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2459 if (unlikely(kw_args > 0)) {
2460 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElements") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2462 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2463 goto __pyx_L5_argtuple_error;
2465 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2466 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2467 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2469 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
2470 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
2471 __pyx_v_material_functions = ((PyObject*)values[2]);
2473 goto __pyx_L4_argument_unpacking_done;
2474 __pyx_L5_argtuple_error:;
2475 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2477 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2478 __Pyx_RefNannyFinishContext();
2480 __pyx_L4_argument_unpacking_done:;
2481 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2482 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2483 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2484 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
2491 __Pyx_RefNannyFinishContext();
2495 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_4setScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
2498 int __pyx_v_material;
2499 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2500 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2501 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
2502 __Pyx_Buffer __pyx_pybuffer_q_vals;
2503 PyObject *__pyx_r = NULL;
2504 __Pyx_RefNannyDeclarations
2507 Py_ssize_t __pyx_t_3;
2510 PyObject *__pyx_t_6 = NULL;
2511 PyObject *__pyx_t_7 = NULL;
2512 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_8;
2513 Py_ssize_t __pyx_t_9;
2514 Py_ssize_t __pyx_t_10;
2516 int __pyx_lineno = 0;
2517 const char *__pyx_filename = NULL;
2518 int __pyx_clineno = 0;
2519 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElements", 0);
2520 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2521 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2522 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2523 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2524 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
2525 __pyx_pybuffer_q_vals.refcount = 0;
2526 __pyx_pybuffernd_q_vals.data = NULL;
2527 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
2529 __Pyx_BufFmt_StackElem __pyx_stack[1];
2530 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2532 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2534 __Pyx_BufFmt_StackElem __pyx_stack[1];
2535 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2537 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
2546 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
2547 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2548 __pyx_v_eN = __pyx_t_2;
2557 __pyx_t_3 = __pyx_v_eN;
2559 if (__pyx_t_3 < 0) {
2560 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2561 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
2562 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2563 if (unlikely(__pyx_t_4 != -1)) {
2564 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2565 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2567 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2576 __pyx_t_5 = (__pyx_v_q_vals->dimensions[1]);
2577 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
2578 __pyx_v_k = __pyx_t_4;
2587 if (unlikely(__pyx_v_material_functions == Py_None)) {
2588 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
2589 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2591 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2592 __Pyx_GOTREF(__pyx_t_6);
2593 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_6);
if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
2594 __Pyx_GOTREF(__pyx_t_7);
2595 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2596 __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_7);
if (unlikely((__pyx_t_8 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2597 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2598 __pyx_t_9 = __pyx_v_eN;
2599 __pyx_t_10 = __pyx_v_k;
2601 if (__pyx_t_9 < 0) {
2602 __pyx_t_9 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
2603 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 0;
2604 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_11 = 0;
2605 if (__pyx_t_10 < 0) {
2606 __pyx_t_10 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
2607 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 1;
2608 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_11 = 1;
2609 if (unlikely(__pyx_t_11 != -1)) {
2610 __Pyx_RaiseBufferIndexError(__pyx_t_11);
2611 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2613 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_8;
2626 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2629 __Pyx_XDECREF(__pyx_t_6);
2630 __Pyx_XDECREF(__pyx_t_7);
2631 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2632 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2633 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2634 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2635 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2636 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2640 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2641 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2643 __Pyx_XGIVEREF(__pyx_r);
2644 __Pyx_RefNannyFinishContext();
2657 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2658 static char __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and set \013ec f_j assuming element is material j\n ";
2659 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements = {
"setVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements};
2660 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2661 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
2662 PyArrayObject *__pyx_v_q_vals = 0;
2663 PyObject *__pyx_v_material_functions = 0;
2664 int __pyx_lineno = 0;
2665 const char *__pyx_filename = NULL;
2666 int __pyx_clineno = 0;
2667 PyObject *__pyx_r = 0;
2668 __Pyx_RefNannyDeclarations
2669 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements (wrapper)", 0);
2671 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
2672 PyObject* values[3] = {0,0,0};
2673 if (unlikely(__pyx_kwds)) {
2675 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2677 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2678 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2679 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2681 default:
goto __pyx_L5_argtuple_error;
2683 kw_args = PyDict_Size(__pyx_kwds);
2686 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
2687 else goto __pyx_L5_argtuple_error;
2689 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
2691 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2694 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2696 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2699 if (unlikely(kw_args > 0)) {
2700 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setVectorMaterialFunctionOverElements") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2702 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
2703 goto __pyx_L5_argtuple_error;
2705 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2706 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2707 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2709 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[0]);
2710 __pyx_v_q_vals = ((PyArrayObject *)values[1]);
2711 __pyx_v_material_functions = ((PyObject*)values[2]);
2713 goto __pyx_L4_argument_unpacking_done;
2714 __pyx_L5_argtuple_error:;
2715 __Pyx_RaiseArgtupleInvalid(
"setVectorMaterialFunctionOverElements", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2717 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2718 __Pyx_RefNannyFinishContext();
2720 __pyx_L4_argument_unpacking_done:;
2721 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2722 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2723 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2724 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_elementMaterialTypes, __pyx_v_q_vals, __pyx_v_material_functions);
2731 __Pyx_RefNannyFinishContext();
2735 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_6setVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
2738 int __pyx_v_material;
2739 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
2740 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
2741 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
2742 __Pyx_Buffer __pyx_pybuffer_q_vals;
2743 PyObject *__pyx_r = NULL;
2744 __Pyx_RefNannyDeclarations
2747 Py_ssize_t __pyx_t_3;
2750 PyObject *__pyx_t_6 = NULL;
2751 PyObject *__pyx_t_7 = NULL;
2752 PyObject *__pyx_t_8 = NULL;
2753 PyObject *__pyx_t_9 = NULL;
2754 int __pyx_lineno = 0;
2755 const char *__pyx_filename = NULL;
2756 int __pyx_clineno = 0;
2757 __Pyx_RefNannySetupContext(
"setVectorMaterialFunctionOverElements", 0);
2758 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
2759 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
2760 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
2761 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
2762 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
2763 __pyx_pybuffer_q_vals.refcount = 0;
2764 __pyx_pybuffernd_q_vals.data = NULL;
2765 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
2767 __Pyx_BufFmt_StackElem __pyx_stack[1];
2768 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2770 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
2772 __Pyx_BufFmt_StackElem __pyx_stack[1];
2773 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2775 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
2784 __pyx_t_1 = (__pyx_v_q_vals->dimensions[0]);
2785 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
2786 __pyx_v_eN = __pyx_t_2;
2795 __pyx_t_3 = __pyx_v_eN;
2797 if (__pyx_t_3 < 0) {
2798 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
2799 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
2800 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
2801 if (unlikely(__pyx_t_4 != -1)) {
2802 __Pyx_RaiseBufferIndexError(__pyx_t_4);
2803 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2805 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
2814 __pyx_t_5 = (__pyx_v_q_vals->dimensions[1]);
2815 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
2816 __pyx_v_k = __pyx_t_4;
2825 if (unlikely(__pyx_v_material_functions == Py_None)) {
2826 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
2827 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2829 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2830 __Pyx_GOTREF(__pyx_t_6);
2831 __pyx_t_7 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_6);
if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
2832 __Pyx_GOTREF(__pyx_t_7);
2833 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2834 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_flat);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2835 __Pyx_GOTREF(__pyx_t_6);
2836 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
2837 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2838 __Pyx_GOTREF(__pyx_t_7);
2839 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2840 __Pyx_GOTREF(__pyx_t_8);
2841 __pyx_t_9 = PyTuple_New(3);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2842 __Pyx_GOTREF(__pyx_t_9);
2843 __Pyx_GIVEREF(__pyx_t_7);
2844 PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7);
2845 __Pyx_GIVEREF(__pyx_t_8);
2846 PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_t_8);
2847 __Pyx_INCREF(__pyx_slice_);
2848 __Pyx_GIVEREF(__pyx_slice_);
2849 PyTuple_SET_ITEM(__pyx_t_9, 2, __pyx_slice_);
2852 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_9, __pyx_t_6) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2853 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
2854 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
2867 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
2870 __Pyx_XDECREF(__pyx_t_6);
2871 __Pyx_XDECREF(__pyx_t_7);
2872 __Pyx_XDECREF(__pyx_t_8);
2873 __Pyx_XDECREF(__pyx_t_9);
2874 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
2875 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
2876 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2877 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2878 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
2879 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
2883 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
2884 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
2886 __Pyx_XGIVEREF(__pyx_r);
2887 __Pyx_RefNannyFinishContext();
2900 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
2901 static char __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and set f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
2902 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
2903 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2904 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
2905 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
2906 PyArrayObject *__pyx_v_ebq_vals = 0;
2907 PyObject *__pyx_v_material_functions = 0;
2908 int __pyx_lineno = 0;
2909 const char *__pyx_filename = NULL;
2910 int __pyx_clineno = 0;
2911 PyObject *__pyx_r = 0;
2912 __Pyx_RefNannyDeclarations
2913 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
2915 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
2916 PyObject* values[4] = {0,0,0,0};
2917 if (unlikely(__pyx_kwds)) {
2919 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2921 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2922 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2923 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2924 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2926 default:
goto __pyx_L5_argtuple_error;
2928 kw_args = PyDict_Size(__pyx_kwds);
2931 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
2932 else goto __pyx_L5_argtuple_error;
2934 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
2936 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2939 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
2941 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2944 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
2946 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2949 if (unlikely(kw_args > 0)) {
2950 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2952 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
2953 goto __pyx_L5_argtuple_error;
2955 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2956 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2957 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2958 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2960 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
2961 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
2962 __pyx_v_ebq_vals = ((PyArrayObject *)values[2]);
2963 __pyx_v_material_functions = ((PyObject*)values[3]);
2965 goto __pyx_L4_argument_unpacking_done;
2966 __pyx_L5_argtuple_error:;
2967 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
2969 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
2970 __Pyx_RefNannyFinishContext();
2972 __pyx_L4_argument_unpacking_done:;
2973 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2974 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2975 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2976 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
2977 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
2984 __Pyx_RefNannyFinishContext();
2988 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_8setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
2991 int __pyx_v_ebN_local;
2993 int __pyx_v_material_left;
2994 int __pyx_v_material_right;
2995 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
2996 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
2997 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
2998 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
2999 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3000 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3001 PyObject *__pyx_r = NULL;
3002 __Pyx_RefNannyDeclarations
3007 Py_ssize_t __pyx_t_5;
3008 Py_ssize_t __pyx_t_6;
3010 Py_ssize_t __pyx_t_8;
3011 Py_ssize_t __pyx_t_9;
3012 Py_ssize_t __pyx_t_10;
3013 Py_ssize_t __pyx_t_11;
3014 npy_intp __pyx_t_12;
3015 PyObject *__pyx_t_13 = NULL;
3016 PyObject *__pyx_t_14 = NULL;
3017 PyObject *__pyx_t_15 = NULL;
3018 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_16;
3019 Py_ssize_t __pyx_t_17;
3020 Py_ssize_t __pyx_t_18;
3021 Py_ssize_t __pyx_t_19;
3023 int __pyx_lineno = 0;
3024 const char *__pyx_filename = NULL;
3025 int __pyx_clineno = 0;
3026 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
3027 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3028 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3029 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3030 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3031 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3032 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3033 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3034 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3035 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3036 __pyx_pybuffer_ebq_vals.refcount = 0;
3037 __pyx_pybuffernd_ebq_vals.data = NULL;
3038 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3040 __Pyx_BufFmt_StackElem __pyx_stack[1];
3041 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3043 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3045 __Pyx_BufFmt_StackElem __pyx_stack[1];
3046 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3048 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3050 __Pyx_BufFmt_StackElem __pyx_stack[1];
3051 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3053 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
3062 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3063 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3064 __pyx_v_eN = __pyx_t_2;
3073 __pyx_t_3 = (__pyx_v_ebq_vals->dimensions[1]);
3074 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3075 __pyx_v_ebN_local = __pyx_t_4;
3084 __pyx_t_5 = __pyx_v_eN;
3085 __pyx_t_6 = __pyx_v_ebN_local;
3087 if (__pyx_t_5 < 0) {
3088 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3089 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
3090 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
3091 if (__pyx_t_6 < 0) {
3092 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3093 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
3094 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
3095 if (unlikely(__pyx_t_7 != -1)) {
3096 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3097 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 84; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3099 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3108 __pyx_t_8 = __pyx_v_ebN;
3111 if (__pyx_t_8 < 0) {
3112 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3113 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
3114 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3115 if (__pyx_t_9 < 0) {
3116 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3117 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
3118 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3119 if (unlikely(__pyx_t_7 != -1)) {
3120 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3121 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3123 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3132 __pyx_t_10 = __pyx_v_ebN;
3135 if (__pyx_t_10 < 0) {
3136 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3137 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
3138 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3139 if (__pyx_t_11 < 0) {
3140 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3141 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
3142 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3143 if (unlikely(__pyx_t_7 != -1)) {
3144 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3145 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3147 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3156 __pyx_t_12 = (__pyx_v_ebq_vals->dimensions[2]);
3157 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
3158 __pyx_v_k = __pyx_t_7;
3167 if (unlikely(__pyx_v_material_functions == Py_None)) {
3168 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3169 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3171 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3172 __Pyx_GOTREF(__pyx_t_13);
3173 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3174 __Pyx_GOTREF(__pyx_t_14);
3175 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3184 if (unlikely(__pyx_v_material_functions == Py_None)) {
3185 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3186 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3188 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3189 __Pyx_GOTREF(__pyx_t_13);
3190 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3191 __Pyx_GOTREF(__pyx_t_15);
3192 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3201 __pyx_t_13 = PyNumber_Add(__pyx_t_14, __pyx_t_15);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3202 __Pyx_GOTREF(__pyx_t_13);
3203 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
3204 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3205 __pyx_t_15 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_13);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3206 __Pyx_GOTREF(__pyx_t_15);
3207 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
3208 __pyx_t_16 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_16 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3209 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
3210 __pyx_t_17 = __pyx_v_eN;
3211 __pyx_t_18 = __pyx_v_ebN_local;
3212 __pyx_t_19 = __pyx_v_k;
3214 if (__pyx_t_17 < 0) {
3215 __pyx_t_17 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3216 if (unlikely(__pyx_t_17 < 0)) __pyx_t_20 = 0;
3217 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_20 = 0;
3218 if (__pyx_t_18 < 0) {
3219 __pyx_t_18 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3220 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 1;
3221 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_20 = 1;
3222 if (__pyx_t_19 < 0) {
3223 __pyx_t_19 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3224 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 2;
3225 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_20 = 2;
3226 if (unlikely(__pyx_t_20 != -1)) {
3227 __Pyx_RaiseBufferIndexError(__pyx_t_20);
3228 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3230 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_16;
3244 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3247 __Pyx_XDECREF(__pyx_t_13);
3248 __Pyx_XDECREF(__pyx_t_14);
3249 __Pyx_XDECREF(__pyx_t_15);
3250 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3251 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3252 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3253 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3254 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3255 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3256 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3260 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3261 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3262 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3264 __Pyx_XGIVEREF(__pyx_r);
3265 __Pyx_RefNannyFinishContext();
3278 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3279 static char __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn} f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3280 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
3281 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3283 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3284 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3285 PyArrayObject *__pyx_v_ebq_vals = 0;
3286 PyObject *__pyx_v_material_functions = 0;
3287 int __pyx_lineno = 0;
3288 const char *__pyx_filename = NULL;
3289 int __pyx_clineno = 0;
3290 PyObject *__pyx_r = 0;
3291 __Pyx_RefNannyDeclarations
3292 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
3294 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
3295 PyObject* values[5] = {0,0,0,0,0};
3296 if (unlikely(__pyx_kwds)) {
3298 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3300 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3301 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3302 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3303 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3304 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3306 default:
goto __pyx_L5_argtuple_error;
3308 kw_args = PyDict_Size(__pyx_kwds);
3311 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
3312 else goto __pyx_L5_argtuple_error;
3314 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3316 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3319 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3321 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3324 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
3326 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3329 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3331 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3334 if (unlikely(kw_args > 0)) {
3335 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3337 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
3338 goto __pyx_L5_argtuple_error;
3340 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3341 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3342 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3343 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3344 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
3346 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3347 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
3348 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
3349 __pyx_v_ebq_vals = ((PyArrayObject *)values[3]);
3350 __pyx_v_material_functions = ((PyObject*)values[4]);
3352 goto __pyx_L4_argument_unpacking_done;
3353 __pyx_L5_argtuple_error:;
3354 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3356 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3357 __Pyx_RefNannyFinishContext();
3359 __pyx_L4_argument_unpacking_done:;
3360 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 92; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3361 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 93; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3362 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 94; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3363 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 95; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3364 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_vals, __pyx_v_material_functions);
3371 __Pyx_RefNannyFinishContext();
3375 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_10setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
3378 int __pyx_v_ebN_local;
3380 int __pyx_v_material_left;
3381 int __pyx_v_material_right;
3384 double __pyx_v_numer;
3385 double __pyx_v_denom;
3386 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
3387 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
3388 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3389 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3390 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3391 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3392 PyObject *__pyx_r = NULL;
3393 __Pyx_RefNannyDeclarations
3398 Py_ssize_t __pyx_t_5;
3399 Py_ssize_t __pyx_t_6;
3401 Py_ssize_t __pyx_t_8;
3402 Py_ssize_t __pyx_t_9;
3403 Py_ssize_t __pyx_t_10;
3404 Py_ssize_t __pyx_t_11;
3405 npy_intp __pyx_t_12;
3410 PyObject *__pyx_t_17 = NULL;
3411 PyObject *__pyx_t_18 = NULL;
3412 PyObject *__pyx_t_19 = NULL;
3413 PyObject *__pyx_t_20 = NULL;
3414 PyObject *__pyx_t_21 = NULL;
3416 Py_ssize_t __pyx_t_23;
3417 Py_ssize_t __pyx_t_24;
3418 Py_ssize_t __pyx_t_25;
3419 Py_ssize_t __pyx_t_26;
3421 int __pyx_lineno = 0;
3422 const char *__pyx_filename = NULL;
3423 int __pyx_clineno = 0;
3424 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
3425 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3426 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3427 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3428 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3429 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3430 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3431 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3432 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3433 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
3434 __pyx_pybuffer_ebq_vals.refcount = 0;
3435 __pyx_pybuffernd_ebq_vals.data = NULL;
3436 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
3438 __Pyx_BufFmt_StackElem __pyx_stack[1];
3439 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3441 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3443 __Pyx_BufFmt_StackElem __pyx_stack[1];
3444 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3446 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3448 __Pyx_BufFmt_StackElem __pyx_stack[1];
3449 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3451 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
3460 __pyx_t_1 = (__pyx_v_ebq_vals->dimensions[0]);
3461 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3462 __pyx_v_eN = __pyx_t_2;
3471 __pyx_t_3 = (__pyx_v_ebq_vals->dimensions[1]);
3472 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
3473 __pyx_v_ebN_local = __pyx_t_4;
3482 __pyx_t_5 = __pyx_v_eN;
3483 __pyx_t_6 = __pyx_v_ebN_local;
3485 if (__pyx_t_5 < 0) {
3486 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
3487 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
3488 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
3489 if (__pyx_t_6 < 0) {
3490 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
3491 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
3492 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
3493 if (unlikely(__pyx_t_7 != -1)) {
3494 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3495 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3497 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
3506 __pyx_t_8 = __pyx_v_ebN;
3509 if (__pyx_t_8 < 0) {
3510 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3511 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
3512 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3513 if (__pyx_t_9 < 0) {
3514 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3515 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
3516 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3517 if (unlikely(__pyx_t_7 != -1)) {
3518 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3519 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3521 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3530 __pyx_t_10 = __pyx_v_ebN;
3533 if (__pyx_t_10 < 0) {
3534 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3535 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
3536 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
3537 if (__pyx_t_11 < 0) {
3538 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3539 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
3540 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
3541 if (unlikely(__pyx_t_7 != -1)) {
3542 __Pyx_RaiseBufferIndexError(__pyx_t_7);
3543 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3545 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3554 __pyx_t_12 = (__pyx_v_ebq_vals->dimensions[2]);
3555 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
3556 __pyx_v_k = __pyx_t_7;
3565 __pyx_t_13 = __pyx_v_nd;
3566 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
3567 __pyx_v_I = __pyx_t_14;
3576 __pyx_t_15 = __pyx_v_nd;
3577 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
3578 __pyx_v_J = __pyx_t_16;
3587 if (unlikely(__pyx_v_material_functions == Py_None)) {
3588 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3589 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3591 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3592 __Pyx_GOTREF(__pyx_t_17);
3593 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3594 __Pyx_GOTREF(__pyx_t_18);
3595 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3596 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3597 __Pyx_GOTREF(__pyx_t_17);
3598 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3599 __Pyx_GOTREF(__pyx_t_19);
3600 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3601 __Pyx_GOTREF(__pyx_t_20);
3602 __Pyx_GIVEREF(__pyx_t_17);
3603 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
3604 __Pyx_GIVEREF(__pyx_t_19);
3605 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
3608 __pyx_t_19 = PyObject_GetItem(__pyx_t_18, __pyx_t_20);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3609 __Pyx_GOTREF(__pyx_t_19);
3610 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3611 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3612 __pyx_t_20 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3613 __Pyx_GOTREF(__pyx_t_20);
3614 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3615 if (unlikely(__pyx_v_material_functions == Py_None)) {
3616 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3617 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3619 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3620 __Pyx_GOTREF(__pyx_t_19);
3621 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_19);
if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3622 __Pyx_GOTREF(__pyx_t_18);
3623 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3624 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3625 __Pyx_GOTREF(__pyx_t_19);
3626 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3627 __Pyx_GOTREF(__pyx_t_17);
3628 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3629 __Pyx_GOTREF(__pyx_t_21);
3630 __Pyx_GIVEREF(__pyx_t_19);
3631 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_19);
3632 __Pyx_GIVEREF(__pyx_t_17);
3633 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_17);
3636 __pyx_t_17 = PyObject_GetItem(__pyx_t_18, __pyx_t_21);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3637 __Pyx_GOTREF(__pyx_t_17);
3638 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3639 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3640 __pyx_t_21 = PyNumber_Multiply(__pyx_t_20, __pyx_t_17);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3641 __Pyx_GOTREF(__pyx_t_21);
3642 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3643 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3644 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3645 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3646 __pyx_v_numer = __pyx_t_22;
3655 if (unlikely(__pyx_v_material_functions == Py_None)) {
3656 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3657 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3659 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3660 __Pyx_GOTREF(__pyx_t_21);
3661 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_21);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3662 __Pyx_GOTREF(__pyx_t_17);
3663 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3664 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3665 __Pyx_GOTREF(__pyx_t_21);
3666 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3667 __Pyx_GOTREF(__pyx_t_20);
3668 __pyx_t_18 = PyTuple_New(2);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3669 __Pyx_GOTREF(__pyx_t_18);
3670 __Pyx_GIVEREF(__pyx_t_21);
3671 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_21);
3672 __Pyx_GIVEREF(__pyx_t_20);
3673 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_20);
3676 __pyx_t_20 = PyObject_GetItem(__pyx_t_17, __pyx_t_18);
if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3677 __Pyx_GOTREF(__pyx_t_20);
3678 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3679 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3680 if (unlikely(__pyx_v_material_functions == Py_None)) {
3681 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
3682 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3684 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3685 __Pyx_GOTREF(__pyx_t_18);
3686 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3687 __Pyx_GOTREF(__pyx_t_17);
3688 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
3689 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3690 __Pyx_GOTREF(__pyx_t_18);
3691 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3692 __Pyx_GOTREF(__pyx_t_21);
3693 __pyx_t_19 = PyTuple_New(2);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3694 __Pyx_GOTREF(__pyx_t_19);
3695 __Pyx_GIVEREF(__pyx_t_18);
3696 PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_18);
3697 __Pyx_GIVEREF(__pyx_t_21);
3698 PyTuple_SET_ITEM(__pyx_t_19, 1, __pyx_t_21);
3701 __pyx_t_21 = PyObject_GetItem(__pyx_t_17, __pyx_t_19);
if (unlikely(__pyx_t_21 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
3702 __Pyx_GOTREF(__pyx_t_21);
3703 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
3704 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3705 __pyx_t_19 = PyNumber_Add(__pyx_t_20, __pyx_t_21);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3706 __Pyx_GOTREF(__pyx_t_19);
3707 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
3708 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3709 __pyx_t_21 = __Pyx_PyFloat_AddObjC(__pyx_t_19, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3710 __Pyx_GOTREF(__pyx_t_21);
3711 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
3712 __pyx_t_22 = __pyx_PyFloat_AsDouble(__pyx_t_21);
if (unlikely((__pyx_t_22 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3713 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
3714 __pyx_v_denom = __pyx_t_22;
3723 if (unlikely(__pyx_v_denom == 0)) {
3724 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
3725 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3727 __pyx_t_23 = __pyx_v_eN;
3728 __pyx_t_24 = __pyx_v_ebN_local;
3729 __pyx_t_25 = __pyx_v_k;
3730 __pyx_t_26 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
3732 if (__pyx_t_23 < 0) {
3733 __pyx_t_23 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
3734 if (unlikely(__pyx_t_23 < 0)) __pyx_t_27 = 0;
3735 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_27 = 0;
3736 if (__pyx_t_24 < 0) {
3737 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
3738 if (unlikely(__pyx_t_24 < 0)) __pyx_t_27 = 1;
3739 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_27 = 1;
3740 if (__pyx_t_25 < 0) {
3741 __pyx_t_25 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
3742 if (unlikely(__pyx_t_25 < 0)) __pyx_t_27 = 2;
3743 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_27 = 2;
3744 if (__pyx_t_26 < 0) {
3745 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
3746 if (unlikely(__pyx_t_26 < 0)) __pyx_t_27 = 3;
3747 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_27 = 3;
3748 if (unlikely(__pyx_t_27 != -1)) {
3749 __Pyx_RaiseBufferIndexError(__pyx_t_27);
3750 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 116; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3752 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_25, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
3768 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3771 __Pyx_XDECREF(__pyx_t_17);
3772 __Pyx_XDECREF(__pyx_t_18);
3773 __Pyx_XDECREF(__pyx_t_19);
3774 __Pyx_XDECREF(__pyx_t_20);
3775 __Pyx_XDECREF(__pyx_t_21);
3776 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
3777 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
3778 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3779 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3780 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3781 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
3782 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3786 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
3787 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
3788 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
3790 __Pyx_XGIVEREF(__pyx_r);
3791 __Pyx_RefNannyFinishContext();
3804 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
3805 static char __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f = 0.5(f^L_j+f^R_k) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
3806 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
3807 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3808 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
3809 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
3810 PyArrayObject *__pyx_v_ebq_global_vals = 0;
3811 PyObject *__pyx_v_material_functions = 0;
3812 int __pyx_lineno = 0;
3813 const char *__pyx_filename = NULL;
3814 int __pyx_clineno = 0;
3815 PyObject *__pyx_r = 0;
3816 __Pyx_RefNannyDeclarations
3817 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
3819 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
3820 PyObject* values[4] = {0,0,0,0};
3821 if (unlikely(__pyx_kwds)) {
3823 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3825 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3826 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3827 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3828 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3830 default:
goto __pyx_L5_argtuple_error;
3832 kw_args = PyDict_Size(__pyx_kwds);
3835 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
3836 else goto __pyx_L5_argtuple_error;
3838 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
3840 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3843 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
3845 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3848 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
3850 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3853 if (unlikely(kw_args > 0)) {
3854 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3856 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
3857 goto __pyx_L5_argtuple_error;
3859 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3860 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3861 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3862 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3864 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[0]);
3865 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[1]);
3866 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[2]);
3867 __pyx_v_material_functions = ((PyObject*)values[3]);
3869 goto __pyx_L4_argument_unpacking_done;
3870 __pyx_L5_argtuple_error:;
3871 __Pyx_RaiseArgtupleInvalid(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
3873 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
3874 __Pyx_RefNannyFinishContext();
3876 __pyx_L4_argument_unpacking_done:;
3877 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3878 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 119; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3879 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3880 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3881 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
3888 __Pyx_RefNannyFinishContext();
3892 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_12setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
3894 int __pyx_v_material_left;
3895 int __pyx_v_material_right;
3897 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
3898 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
3899 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
3900 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
3901 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
3902 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
3903 PyObject *__pyx_r = NULL;
3904 __Pyx_RefNannyDeclarations
3907 Py_ssize_t __pyx_t_3;
3908 Py_ssize_t __pyx_t_4;
3910 Py_ssize_t __pyx_t_6;
3911 Py_ssize_t __pyx_t_7;
3914 PyObject *__pyx_t_10 = NULL;
3915 PyObject *__pyx_t_11 = NULL;
3916 PyObject *__pyx_t_12 = NULL;
3917 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
3918 Py_ssize_t __pyx_t_14;
3919 Py_ssize_t __pyx_t_15;
3920 int __pyx_lineno = 0;
3921 const char *__pyx_filename = NULL;
3922 int __pyx_clineno = 0;
3923 __Pyx_RefNannySetupContext(
"setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
3924 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
3925 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
3926 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
3927 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
3928 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
3929 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
3930 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
3931 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
3932 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
3933 __pyx_pybuffer_ebq_global_vals.refcount = 0;
3934 __pyx_pybuffernd_ebq_global_vals.data = NULL;
3935 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
3937 __Pyx_BufFmt_StackElem __pyx_stack[1];
3938 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3940 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
3942 __Pyx_BufFmt_StackElem __pyx_stack[1];
3943 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3945 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
3947 __Pyx_BufFmt_StackElem __pyx_stack[1];
3948 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3950 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
3959 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
3960 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
3961 __pyx_v_ebN = __pyx_t_2;
3970 __pyx_t_3 = __pyx_v_ebN;
3973 if (__pyx_t_3 < 0) {
3974 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3975 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
3976 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
3977 if (__pyx_t_4 < 0) {
3978 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
3979 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
3980 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
3981 if (unlikely(__pyx_t_5 != -1)) {
3982 __Pyx_RaiseBufferIndexError(__pyx_t_5);
3983 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
3985 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
3994 __pyx_t_6 = __pyx_v_ebN;
3997 if (__pyx_t_6 < 0) {
3998 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
3999 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
4000 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4001 if (__pyx_t_7 < 0) {
4002 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4003 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
4004 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4005 if (unlikely(__pyx_t_5 != -1)) {
4006 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4007 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4009 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4018 __pyx_t_8 = (__pyx_v_ebq_global_vals->dimensions[1]);
4019 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
4020 __pyx_v_k = __pyx_t_9;
4029 if (unlikely(__pyx_v_material_functions == Py_None)) {
4030 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4031 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4033 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4034 __Pyx_GOTREF(__pyx_t_10);
4035 __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4036 __Pyx_GOTREF(__pyx_t_11);
4037 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4046 if (unlikely(__pyx_v_material_functions == Py_None)) {
4047 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4048 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4050 __pyx_t_10 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4051 __Pyx_GOTREF(__pyx_t_10);
4052 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_10);
if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4053 __Pyx_GOTREF(__pyx_t_12);
4054 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4063 __pyx_t_10 = PyNumber_Add(__pyx_t_11, __pyx_t_12);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4064 __Pyx_GOTREF(__pyx_t_10);
4065 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
4066 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4067 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_10);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4068 __Pyx_GOTREF(__pyx_t_12);
4069 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4070 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_13 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4071 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4072 __pyx_t_14 = __pyx_v_ebN;
4073 __pyx_t_15 = __pyx_v_k;
4075 if (__pyx_t_14 < 0) {
4076 __pyx_t_14 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4077 if (unlikely(__pyx_t_14 < 0)) __pyx_t_5 = 0;
4078 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_5 = 0;
4079 if (__pyx_t_15 < 0) {
4080 __pyx_t_15 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4081 if (unlikely(__pyx_t_15 < 0)) __pyx_t_5 = 1;
4082 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_5 = 1;
4083 if (unlikely(__pyx_t_5 != -1)) {
4084 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4085 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4087 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_13;
4100 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4103 __Pyx_XDECREF(__pyx_t_10);
4104 __Pyx_XDECREF(__pyx_t_11);
4105 __Pyx_XDECREF(__pyx_t_12);
4106 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4107 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4108 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4109 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4110 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4111 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4112 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4116 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4117 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4118 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4120 __Pyx_XGIVEREF(__pyx_r);
4121 __Pyx_RefNannyFinishContext();
4134 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4135 static char __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn} = f^L_{j,mn}f^R_{k,mn}/(f^L_{j,mn}+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
4136 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
4137 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4139 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
4140 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
4141 PyArrayObject *__pyx_v_ebq_global_vals = 0;
4142 PyObject *__pyx_v_material_functions = 0;
4143 int __pyx_lineno = 0;
4144 const char *__pyx_filename = NULL;
4145 int __pyx_clineno = 0;
4146 PyObject *__pyx_r = 0;
4147 __Pyx_RefNannyDeclarations
4148 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
4150 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
4151 PyObject* values[5] = {0,0,0,0,0};
4152 if (unlikely(__pyx_kwds)) {
4154 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4156 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4157 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4158 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4159 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4160 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4162 default:
goto __pyx_L5_argtuple_error;
4164 kw_args = PyDict_Size(__pyx_kwds);
4167 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
4168 else goto __pyx_L5_argtuple_error;
4170 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
4172 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4175 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
4177 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4180 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
4182 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4185 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4187 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4190 if (unlikely(kw_args > 0)) {
4191 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4193 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4194 goto __pyx_L5_argtuple_error;
4196 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4197 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4198 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4199 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4200 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4202 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4203 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
4204 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
4205 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[3]);
4206 __pyx_v_material_functions = ((PyObject*)values[4]);
4208 goto __pyx_L4_argument_unpacking_done;
4209 __pyx_L5_argtuple_error:;
4210 __Pyx_RaiseArgtupleInvalid(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4212 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4213 __Pyx_RefNannyFinishContext();
4215 __pyx_L4_argument_unpacking_done:;
4216 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4217 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4218 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 142; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4219 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4220 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
4227 __Pyx_RefNannyFinishContext();
4231 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_14setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
4234 int __pyx_v_material_left;
4235 int __pyx_v_material_right;
4238 double __pyx_v_numer;
4239 double __pyx_v_denom;
4240 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
4241 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
4242 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
4243 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
4244 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
4245 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
4246 PyObject *__pyx_r = NULL;
4247 __Pyx_RefNannyDeclarations
4250 Py_ssize_t __pyx_t_3;
4251 Py_ssize_t __pyx_t_4;
4253 Py_ssize_t __pyx_t_6;
4254 Py_ssize_t __pyx_t_7;
4260 PyObject *__pyx_t_13 = NULL;
4261 PyObject *__pyx_t_14 = NULL;
4262 PyObject *__pyx_t_15 = NULL;
4263 PyObject *__pyx_t_16 = NULL;
4264 PyObject *__pyx_t_17 = NULL;
4266 Py_ssize_t __pyx_t_19;
4267 Py_ssize_t __pyx_t_20;
4268 Py_ssize_t __pyx_t_21;
4270 int __pyx_lineno = 0;
4271 const char *__pyx_filename = NULL;
4272 int __pyx_clineno = 0;
4273 __Pyx_RefNannySetupContext(
"setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
4274 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
4275 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
4276 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
4277 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
4278 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
4279 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
4280 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
4281 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
4282 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
4283 __pyx_pybuffer_ebq_global_vals.refcount = 0;
4284 __pyx_pybuffernd_ebq_global_vals.data = NULL;
4285 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
4287 __Pyx_BufFmt_StackElem __pyx_stack[1];
4288 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4290 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
4292 __Pyx_BufFmt_StackElem __pyx_stack[1];
4293 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4295 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
4297 __Pyx_BufFmt_StackElem __pyx_stack[1];
4298 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4300 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
4309 __pyx_t_1 = (__pyx_v_ebq_global_vals->dimensions[0]);
4310 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
4311 __pyx_v_ebN = __pyx_t_2;
4320 __pyx_t_3 = __pyx_v_ebN;
4323 if (__pyx_t_3 < 0) {
4324 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4325 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
4326 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4327 if (__pyx_t_4 < 0) {
4328 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4329 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
4330 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4331 if (unlikely(__pyx_t_5 != -1)) {
4332 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4333 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4335 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4344 __pyx_t_6 = __pyx_v_ebN;
4347 if (__pyx_t_6 < 0) {
4348 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
4349 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
4350 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
4351 if (__pyx_t_7 < 0) {
4352 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
4353 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
4354 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
4355 if (unlikely(__pyx_t_5 != -1)) {
4356 __Pyx_RaiseBufferIndexError(__pyx_t_5);
4357 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4359 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
4368 __pyx_t_8 = (__pyx_v_ebq_global_vals->dimensions[1]);
4369 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
4370 __pyx_v_k = __pyx_t_5;
4379 __pyx_t_9 = __pyx_v_nd;
4380 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
4381 __pyx_v_I = __pyx_t_10;
4390 __pyx_t_11 = __pyx_v_nd;
4391 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
4392 __pyx_v_J = __pyx_t_12;
4401 if (unlikely(__pyx_v_material_functions == Py_None)) {
4402 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4403 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4405 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4406 __Pyx_GOTREF(__pyx_t_13);
4407 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4408 __Pyx_GOTREF(__pyx_t_14);
4409 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4410 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4411 __Pyx_GOTREF(__pyx_t_13);
4412 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4413 __Pyx_GOTREF(__pyx_t_15);
4414 __pyx_t_16 = PyTuple_New(2);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4415 __Pyx_GOTREF(__pyx_t_16);
4416 __Pyx_GIVEREF(__pyx_t_13);
4417 PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_13);
4418 __Pyx_GIVEREF(__pyx_t_15);
4419 PyTuple_SET_ITEM(__pyx_t_16, 1, __pyx_t_15);
4422 __pyx_t_15 = PyObject_GetItem(__pyx_t_14, __pyx_t_16);
if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4423 __Pyx_GOTREF(__pyx_t_15);
4424 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4425 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4426 __pyx_t_16 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_15);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4427 __Pyx_GOTREF(__pyx_t_16);
4428 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4429 if (unlikely(__pyx_v_material_functions == Py_None)) {
4430 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4431 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4433 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4434 __Pyx_GOTREF(__pyx_t_15);
4435 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_15);
if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4436 __Pyx_GOTREF(__pyx_t_14);
4437 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4438 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4439 __Pyx_GOTREF(__pyx_t_15);
4440 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4441 __Pyx_GOTREF(__pyx_t_13);
4442 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4443 __Pyx_GOTREF(__pyx_t_17);
4444 __Pyx_GIVEREF(__pyx_t_15);
4445 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
4446 __Pyx_GIVEREF(__pyx_t_13);
4447 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_13);
4450 __pyx_t_13 = PyObject_GetItem(__pyx_t_14, __pyx_t_17);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4451 __Pyx_GOTREF(__pyx_t_13);
4452 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4453 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4454 __pyx_t_17 = PyNumber_Multiply(__pyx_t_16, __pyx_t_13);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4455 __Pyx_GOTREF(__pyx_t_17);
4456 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4457 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4458 __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_18 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4459 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4460 __pyx_v_numer = __pyx_t_18;
4469 if (unlikely(__pyx_v_material_functions == Py_None)) {
4470 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4471 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4473 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4474 __Pyx_GOTREF(__pyx_t_17);
4475 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4476 __Pyx_GOTREF(__pyx_t_13);
4477 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4478 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4479 __Pyx_GOTREF(__pyx_t_17);
4480 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4481 __Pyx_GOTREF(__pyx_t_16);
4482 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4483 __Pyx_GOTREF(__pyx_t_14);
4484 __Pyx_GIVEREF(__pyx_t_17);
4485 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17);
4486 __Pyx_GIVEREF(__pyx_t_16);
4487 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16);
4490 __pyx_t_16 = PyObject_GetItem(__pyx_t_13, __pyx_t_14);
if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4491 __Pyx_GOTREF(__pyx_t_16);
4492 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4493 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4494 if (unlikely(__pyx_v_material_functions == Py_None)) {
4495 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4496 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4498 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4499 __Pyx_GOTREF(__pyx_t_14);
4500 __pyx_t_13 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4501 __Pyx_GOTREF(__pyx_t_13);
4502 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
4503 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4504 __Pyx_GOTREF(__pyx_t_14);
4505 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4506 __Pyx_GOTREF(__pyx_t_17);
4507 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4508 __Pyx_GOTREF(__pyx_t_15);
4509 __Pyx_GIVEREF(__pyx_t_14);
4510 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_14);
4511 __Pyx_GIVEREF(__pyx_t_17);
4512 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_17);
4515 __pyx_t_17 = PyObject_GetItem(__pyx_t_13, __pyx_t_15);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4516 __Pyx_GOTREF(__pyx_t_17);
4517 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
4518 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4519 __pyx_t_15 = PyNumber_Add(__pyx_t_16, __pyx_t_17);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4520 __Pyx_GOTREF(__pyx_t_15);
4521 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
4522 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4523 __pyx_t_17 = __Pyx_PyFloat_AddObjC(__pyx_t_15, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4524 __Pyx_GOTREF(__pyx_t_17);
4525 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
4526 __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_17);
if (unlikely((__pyx_t_18 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4527 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
4528 __pyx_v_denom = __pyx_t_18;
4537 if (unlikely(__pyx_v_denom == 0)) {
4538 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
4539 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4541 __pyx_t_19 = __pyx_v_ebN;
4542 __pyx_t_20 = __pyx_v_k;
4543 __pyx_t_21 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
4545 if (__pyx_t_19 < 0) {
4546 __pyx_t_19 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
4547 if (unlikely(__pyx_t_19 < 0)) __pyx_t_22 = 0;
4548 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_22 = 0;
4549 if (__pyx_t_20 < 0) {
4550 __pyx_t_20 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
4551 if (unlikely(__pyx_t_20 < 0)) __pyx_t_22 = 1;
4552 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_22 = 1;
4553 if (__pyx_t_21 < 0) {
4554 __pyx_t_21 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
4555 if (unlikely(__pyx_t_21 < 0)) __pyx_t_22 = 2;
4556 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_22 = 2;
4557 if (unlikely(__pyx_t_22 != -1)) {
4558 __Pyx_RaiseBufferIndexError(__pyx_t_22);
4559 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4561 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
4576 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4579 __Pyx_XDECREF(__pyx_t_13);
4580 __Pyx_XDECREF(__pyx_t_14);
4581 __Pyx_XDECREF(__pyx_t_15);
4582 __Pyx_XDECREF(__pyx_t_16);
4583 __Pyx_XDECREF(__pyx_t_17);
4584 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4585 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4586 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4587 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4588 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4589 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4590 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
4594 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
4595 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
4596 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
4598 __Pyx_XGIVEREF(__pyx_r);
4599 __Pyx_RefNannyFinishContext();
4612 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4613 static char __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function f_j(x,t) assuming element is material j\n likely little improvement right now without correct typing of material_functions\n ";
4614 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements = {
"evaluateScalarMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements};
4615 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4617 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
4618 PyArrayObject *__pyx_v_x = 0;
4619 PyArrayObject *__pyx_v_q_vals = 0;
4620 PyObject *__pyx_v_material_functions = 0;
4621 int __pyx_lineno = 0;
4622 const char *__pyx_filename = NULL;
4623 int __pyx_clineno = 0;
4624 PyObject *__pyx_r = 0;
4625 __Pyx_RefNannyDeclarations
4626 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements (wrapper)", 0);
4628 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
4629 PyObject* values[5] = {0,0,0,0,0};
4630 if (unlikely(__pyx_kwds)) {
4632 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4634 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4635 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4636 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4637 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4638 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4640 default:
goto __pyx_L5_argtuple_error;
4642 kw_args = PyDict_Size(__pyx_kwds);
4645 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4646 else goto __pyx_L5_argtuple_error;
4648 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
4650 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4653 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4655 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4658 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
4660 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4663 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4665 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4668 if (unlikely(kw_args > 0)) {
4669 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElements") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4671 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4672 goto __pyx_L5_argtuple_error;
4674 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4675 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4676 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4677 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4678 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4680 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4681 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
4682 __pyx_v_x = ((PyArrayObject *)values[2]);
4683 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
4684 __pyx_v_material_functions = ((PyObject*)values[4]);
4686 goto __pyx_L4_argument_unpacking_done;
4687 __pyx_L5_argtuple_error:;
4688 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4690 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4691 __Pyx_RefNannyFinishContext();
4693 __pyx_L4_argument_unpacking_done:;
4694 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4695 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4696 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 168; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4697 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4698 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
4705 __Pyx_RefNannyFinishContext();
4709 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_16evaluateScalarMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
4712 int __pyx_v_material;
4713 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
4714 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
4715 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
4716 __Pyx_Buffer __pyx_pybuffer_q_vals;
4717 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
4718 __Pyx_Buffer __pyx_pybuffer_x;
4719 PyObject *__pyx_r = NULL;
4720 __Pyx_RefNannyDeclarations
4723 Py_ssize_t __pyx_t_3;
4726 PyObject *__pyx_t_6 = NULL;
4727 PyObject *__pyx_t_7 = NULL;
4728 PyObject *__pyx_t_8 = NULL;
4729 PyObject *__pyx_t_9 = NULL;
4730 PyObject *__pyx_t_10 = NULL;
4731 Py_ssize_t __pyx_t_11;
4732 PyObject *__pyx_t_12 = NULL;
4733 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_13;
4734 Py_ssize_t __pyx_t_14;
4735 Py_ssize_t __pyx_t_15;
4737 int __pyx_lineno = 0;
4738 const char *__pyx_filename = NULL;
4739 int __pyx_clineno = 0;
4740 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElements", 0);
4741 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
4742 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
4743 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
4744 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
4745 __pyx_pybuffer_x.pybuffer.buf = NULL;
4746 __pyx_pybuffer_x.refcount = 0;
4747 __pyx_pybuffernd_x.data = NULL;
4748 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
4749 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
4750 __pyx_pybuffer_q_vals.refcount = 0;
4751 __pyx_pybuffernd_q_vals.data = NULL;
4752 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
4754 __Pyx_BufFmt_StackElem __pyx_stack[1];
4755 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4757 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
4759 __Pyx_BufFmt_StackElem __pyx_stack[1];
4760 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4762 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
4764 __Pyx_BufFmt_StackElem __pyx_stack[1];
4765 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4767 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1];
4776 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
4777 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
4778 __pyx_v_eN = __pyx_t_2;
4787 __pyx_t_3 = __pyx_v_eN;
4789 if (__pyx_t_3 < 0) {
4790 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
4791 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
4792 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
4793 if (unlikely(__pyx_t_4 != -1)) {
4794 __Pyx_RaiseBufferIndexError(__pyx_t_4);
4795 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4797 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
4806 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
4807 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
4808 __pyx_v_k = __pyx_t_4;
4817 if (unlikely(__pyx_v_material_functions == Py_None)) {
4818 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
4819 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4821 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4822 __Pyx_GOTREF(__pyx_t_7);
4823 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_7);
if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4824 __Pyx_GOTREF(__pyx_t_8);
4825 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4826 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4827 __Pyx_GOTREF(__pyx_t_7);
4828 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4829 __Pyx_GOTREF(__pyx_t_9);
4830 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4831 __Pyx_GOTREF(__pyx_t_10);
4832 __Pyx_GIVEREF(__pyx_t_7);
4833 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
4834 __Pyx_GIVEREF(__pyx_t_9);
4835 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
4838 __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_10);
if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
4839 __Pyx_GOTREF(__pyx_t_9);
4840 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
4841 __pyx_t_10 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4842 __Pyx_GOTREF(__pyx_t_10);
4845 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
4846 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
4847 if (likely(__pyx_t_7)) {
4848 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
4849 __Pyx_INCREF(__pyx_t_7);
4850 __Pyx_INCREF(
function);
4851 __Pyx_DECREF_SET(__pyx_t_8,
function);
4855 __pyx_t_12 = PyTuple_New(2+__pyx_t_11);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4856 __Pyx_GOTREF(__pyx_t_12);
4858 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
4860 __Pyx_GIVEREF(__pyx_t_9);
4861 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_9);
4862 __Pyx_GIVEREF(__pyx_t_10);
4863 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
4866 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4867 __Pyx_GOTREF(__pyx_t_6);
4868 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
4869 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4870 __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_6);
if (unlikely((__pyx_t_13 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4871 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4872 __pyx_t_14 = __pyx_v_eN;
4873 __pyx_t_15 = __pyx_v_k;
4875 if (__pyx_t_14 < 0) {
4876 __pyx_t_14 += __pyx_pybuffernd_q_vals.diminfo[0].shape;
4877 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
4878 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_vals.diminfo[0].shape)) __pyx_t_16 = 0;
4879 if (__pyx_t_15 < 0) {
4880 __pyx_t_15 += __pyx_pybuffernd_q_vals.diminfo[1].shape;
4881 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
4882 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_vals.diminfo[1].shape)) __pyx_t_16 = 1;
4883 if (unlikely(__pyx_t_16 != -1)) {
4884 __Pyx_RaiseBufferIndexError(__pyx_t_16);
4885 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
4887 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_vals.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_vals.diminfo[1].strides) = __pyx_t_13;
4900 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4903 __Pyx_XDECREF(__pyx_t_6);
4904 __Pyx_XDECREF(__pyx_t_7);
4905 __Pyx_XDECREF(__pyx_t_8);
4906 __Pyx_XDECREF(__pyx_t_9);
4907 __Pyx_XDECREF(__pyx_t_10);
4908 __Pyx_XDECREF(__pyx_t_12);
4909 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
4910 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
4911 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
4912 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
4913 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
4914 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
4915 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
4919 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
4920 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
4921 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
4923 __Pyx_XGIVEREF(__pyx_r);
4924 __Pyx_RefNannyFinishContext();
4937 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
4938 static char __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements[] =
"\n loop over quadrature array and evaluate function \013ec f_j(x,t) assuming element is material j\n ";
4939 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements = {
"evaluateVectorMaterialFunctionOverElements", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements};
4940 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4942 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
4943 PyArrayObject *__pyx_v_x = 0;
4944 PyArrayObject *__pyx_v_q_vals = 0;
4945 PyObject *__pyx_v_material_functions = 0;
4946 int __pyx_lineno = 0;
4947 const char *__pyx_filename = NULL;
4948 int __pyx_clineno = 0;
4949 PyObject *__pyx_r = 0;
4950 __Pyx_RefNannyDeclarations
4951 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements (wrapper)", 0);
4953 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_x,&__pyx_n_s_q_vals,&__pyx_n_s_material_functions,0};
4954 PyObject* values[5] = {0,0,0,0,0};
4955 if (unlikely(__pyx_kwds)) {
4957 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4959 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
4960 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
4961 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4962 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4963 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4965 default:
goto __pyx_L5_argtuple_error;
4967 kw_args = PyDict_Size(__pyx_kwds);
4970 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4971 else goto __pyx_L5_argtuple_error;
4973 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
4975 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4978 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4980 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4983 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_vals)) != 0)) kw_args--;
4985 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4988 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
4990 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4993 if (unlikely(kw_args > 0)) {
4994 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateVectorMaterialFunctionOverElements") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
4996 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
4997 goto __pyx_L5_argtuple_error;
4999 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5000 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5001 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5002 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5003 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5005 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5006 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[1]);
5007 __pyx_v_x = ((PyArrayObject *)values[2]);
5008 __pyx_v_q_vals = ((PyArrayObject *)values[3]);
5009 __pyx_v_material_functions = ((PyObject*)values[4]);
5011 goto __pyx_L4_argument_unpacking_done;
5012 __pyx_L5_argtuple_error:;
5013 __Pyx_RaiseArgtupleInvalid(
"evaluateVectorMaterialFunctionOverElements", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5015 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5016 __Pyx_RefNannyFinishContext();
5018 __pyx_L4_argument_unpacking_done:;
5019 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5020 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5021 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_vals), __pyx_ptype_5numpy_ndarray, 1,
"q_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5022 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5023 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(__pyx_self, __pyx_v_t, __pyx_v_elementMaterialTypes, __pyx_v_x, __pyx_v_q_vals, __pyx_v_material_functions);
5030 __Pyx_RefNannyFinishContext();
5034 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_18evaluateVectorMaterialFunctionOverElements(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_q_vals, PyObject *__pyx_v_material_functions) {
5037 int __pyx_v_material;
5038 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
5039 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
5040 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_vals;
5041 __Pyx_Buffer __pyx_pybuffer_q_vals;
5042 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5043 __Pyx_Buffer __pyx_pybuffer_x;
5044 PyObject *__pyx_r = NULL;
5045 __Pyx_RefNannyDeclarations
5048 Py_ssize_t __pyx_t_3;
5051 PyObject *__pyx_t_6 = NULL;
5052 PyObject *__pyx_t_7 = NULL;
5053 PyObject *__pyx_t_8 = NULL;
5054 PyObject *__pyx_t_9 = NULL;
5055 PyObject *__pyx_t_10 = NULL;
5056 Py_ssize_t __pyx_t_11;
5057 PyObject *__pyx_t_12 = NULL;
5058 int __pyx_lineno = 0;
5059 const char *__pyx_filename = NULL;
5060 int __pyx_clineno = 0;
5061 __Pyx_RefNannySetupContext(
"evaluateVectorMaterialFunctionOverElements", 0);
5062 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
5063 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
5064 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
5065 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
5066 __pyx_pybuffer_x.pybuffer.buf = NULL;
5067 __pyx_pybuffer_x.refcount = 0;
5068 __pyx_pybuffernd_x.data = NULL;
5069 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5070 __pyx_pybuffer_q_vals.pybuffer.buf = NULL;
5071 __pyx_pybuffer_q_vals.refcount = 0;
5072 __pyx_pybuffernd_q_vals.data = NULL;
5073 __pyx_pybuffernd_q_vals.rcbuffer = &__pyx_pybuffer_q_vals;
5075 __Pyx_BufFmt_StackElem __pyx_stack[1];
5076 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5078 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
5080 __Pyx_BufFmt_StackElem __pyx_stack[1];
5081 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5083 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
5085 __Pyx_BufFmt_StackElem __pyx_stack[1];
5086 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5088 __pyx_pybuffernd_q_vals.diminfo[0].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_vals.diminfo[0].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_vals.diminfo[1].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_vals.diminfo[1].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_vals.diminfo[2].strides = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_vals.diminfo[2].shape = __pyx_pybuffernd_q_vals.rcbuffer->pybuffer.shape[2];
5097 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5098 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5099 __pyx_v_eN = __pyx_t_2;
5108 __pyx_t_3 = __pyx_v_eN;
5110 if (__pyx_t_3 < 0) {
5111 __pyx_t_3 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
5112 if (unlikely(__pyx_t_3 < 0)) __pyx_t_4 = 0;
5113 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_4 = 0;
5114 if (unlikely(__pyx_t_4 != -1)) {
5115 __Pyx_RaiseBufferIndexError(__pyx_t_4);
5116 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5118 __pyx_v_material = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
5127 __pyx_t_5 = (__pyx_v_x->dimensions[1]);
5128 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_5; __pyx_t_4+=1) {
5129 __pyx_v_k = __pyx_t_4;
5138 if (unlikely(__pyx_v_material_functions == Py_None)) {
5139 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5140 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5142 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_material);
if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5143 __Pyx_GOTREF(__pyx_t_7);
5144 __pyx_t_8 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_7);
if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5145 __Pyx_GOTREF(__pyx_t_8);
5146 __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5147 __pyx_t_7 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5148 __Pyx_GOTREF(__pyx_t_7);
5149 __pyx_t_9 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5150 __Pyx_GOTREF(__pyx_t_9);
5151 __pyx_t_10 = PyTuple_New(2);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5152 __Pyx_GOTREF(__pyx_t_10);
5153 __Pyx_GIVEREF(__pyx_t_7);
5154 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_7);
5155 __Pyx_GIVEREF(__pyx_t_9);
5156 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
5159 __pyx_t_9 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_10);
if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5160 __Pyx_GOTREF(__pyx_t_9);
5161 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5162 __pyx_t_10 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5163 __Pyx_GOTREF(__pyx_t_10);
5166 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
5167 __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_8);
5168 if (likely(__pyx_t_7)) {
5169 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
5170 __Pyx_INCREF(__pyx_t_7);
5171 __Pyx_INCREF(
function);
5172 __Pyx_DECREF_SET(__pyx_t_8,
function);
5176 __pyx_t_12 = PyTuple_New(2+__pyx_t_11);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5177 __Pyx_GOTREF(__pyx_t_12);
5179 __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_12, 0, __pyx_t_7); __pyx_t_7 = NULL;
5181 __Pyx_GIVEREF(__pyx_t_9);
5182 PyTuple_SET_ITEM(__pyx_t_12, 0+__pyx_t_11, __pyx_t_9);
5183 __Pyx_GIVEREF(__pyx_t_10);
5184 PyTuple_SET_ITEM(__pyx_t_12, 1+__pyx_t_11, __pyx_t_10);
5187 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_12, NULL);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5188 __Pyx_GOTREF(__pyx_t_6);
5189 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
5190 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5191 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_flat);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5192 __Pyx_GOTREF(__pyx_t_8);
5193 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5194 __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5195 __Pyx_GOTREF(__pyx_t_6);
5196 __pyx_t_12 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5197 __Pyx_GOTREF(__pyx_t_12);
5198 __pyx_t_10 = PyTuple_New(3);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5199 __Pyx_GOTREF(__pyx_t_10);
5200 __Pyx_GIVEREF(__pyx_t_6);
5201 PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6);
5202 __Pyx_GIVEREF(__pyx_t_12);
5203 PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_12);
5204 __Pyx_INCREF(__pyx_slice__2);
5205 __Pyx_GIVEREF(__pyx_slice__2);
5206 PyTuple_SET_ITEM(__pyx_t_10, 2, __pyx_slice__2);
5209 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_q_vals), __pyx_t_10, __pyx_t_8) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5210 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
5211 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5224 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5227 __Pyx_XDECREF(__pyx_t_6);
5228 __Pyx_XDECREF(__pyx_t_7);
5229 __Pyx_XDECREF(__pyx_t_8);
5230 __Pyx_XDECREF(__pyx_t_9);
5231 __Pyx_XDECREF(__pyx_t_10);
5232 __Pyx_XDECREF(__pyx_t_12);
5233 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5234 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5235 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5236 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5237 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5238 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5239 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateVectorMaterialFunctionOverElements", __pyx_clineno, __pyx_lineno, __pyx_filename);
5243 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
5244 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_vals.rcbuffer->pybuffer);
5245 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5247 __Pyx_XGIVEREF(__pyx_r);
5248 __Pyx_RefNannyFinishContext();
5261 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5262 static char __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5263 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage};
5264 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5266 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5267 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5268 PyArrayObject *__pyx_v_x = 0;
5269 PyArrayObject *__pyx_v_ebq_vals = 0;
5270 PyObject *__pyx_v_material_functions = 0;
5271 int __pyx_lineno = 0;
5272 const char *__pyx_filename = NULL;
5273 int __pyx_clineno = 0;
5274 PyObject *__pyx_r = 0;
5275 __Pyx_RefNannyDeclarations
5276 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage (wrapper)", 0);
5278 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5279 PyObject* values[6] = {0,0,0,0,0,0};
5280 if (unlikely(__pyx_kwds)) {
5282 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5284 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5285 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5286 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5287 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5288 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5289 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5291 default:
goto __pyx_L5_argtuple_error;
5293 kw_args = PyDict_Size(__pyx_kwds);
5296 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5297 else goto __pyx_L5_argtuple_error;
5299 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
5301 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5304 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
5306 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5309 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5311 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5314 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
5316 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5319 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5321 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5324 if (unlikely(kw_args > 0)) {
5325 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5327 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
5328 goto __pyx_L5_argtuple_error;
5330 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5331 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5332 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5333 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5334 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5335 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5337 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5338 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
5339 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
5340 __pyx_v_x = ((PyArrayObject *)values[3]);
5341 __pyx_v_ebq_vals = ((PyArrayObject *)values[4]);
5342 __pyx_v_material_functions = ((PyObject*)values[5]);
5344 goto __pyx_L4_argument_unpacking_done;
5345 __pyx_L5_argtuple_error:;
5346 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5348 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5349 __Pyx_RefNannyFinishContext();
5351 __pyx_L4_argument_unpacking_done:;
5352 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5353 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5354 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5355 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5356 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5357 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
5364 __Pyx_RefNannyFinishContext();
5368 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_20evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
5371 int __pyx_v_ebN_local;
5373 int __pyx_v_material_left;
5374 int __pyx_v_material_right;
5375 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
5376 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
5377 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
5378 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
5379 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
5380 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
5381 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5382 __Pyx_Buffer __pyx_pybuffer_x;
5383 PyObject *__pyx_r = NULL;
5384 __Pyx_RefNannyDeclarations
5389 Py_ssize_t __pyx_t_5;
5390 Py_ssize_t __pyx_t_6;
5392 Py_ssize_t __pyx_t_8;
5393 Py_ssize_t __pyx_t_9;
5394 Py_ssize_t __pyx_t_10;
5395 Py_ssize_t __pyx_t_11;
5396 npy_intp __pyx_t_12;
5397 PyObject *__pyx_t_13 = NULL;
5398 PyObject *__pyx_t_14 = NULL;
5399 PyObject *__pyx_t_15 = NULL;
5400 PyObject *__pyx_t_16 = NULL;
5401 PyObject *__pyx_t_17 = NULL;
5402 PyObject *__pyx_t_18 = NULL;
5403 Py_ssize_t __pyx_t_19;
5404 PyObject *__pyx_t_20 = NULL;
5405 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_21;
5406 Py_ssize_t __pyx_t_22;
5407 Py_ssize_t __pyx_t_23;
5408 Py_ssize_t __pyx_t_24;
5410 int __pyx_lineno = 0;
5411 const char *__pyx_filename = NULL;
5412 int __pyx_clineno = 0;
5413 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", 0);
5414 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
5415 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
5416 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
5417 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
5418 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
5419 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
5420 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
5421 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
5422 __pyx_pybuffer_x.pybuffer.buf = NULL;
5423 __pyx_pybuffer_x.refcount = 0;
5424 __pyx_pybuffernd_x.data = NULL;
5425 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5426 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
5427 __pyx_pybuffer_ebq_vals.refcount = 0;
5428 __pyx_pybuffernd_ebq_vals.data = NULL;
5429 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
5431 __Pyx_BufFmt_StackElem __pyx_stack[1];
5432 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5434 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
5436 __Pyx_BufFmt_StackElem __pyx_stack[1];
5437 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5439 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
5441 __Pyx_BufFmt_StackElem __pyx_stack[1];
5442 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5444 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
5446 __Pyx_BufFmt_StackElem __pyx_stack[1];
5447 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5449 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2];
5458 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5459 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5460 __pyx_v_eN = __pyx_t_2;
5469 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
5470 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
5471 __pyx_v_ebN_local = __pyx_t_4;
5480 __pyx_t_5 = __pyx_v_eN;
5481 __pyx_t_6 = __pyx_v_ebN_local;
5483 if (__pyx_t_5 < 0) {
5484 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
5485 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
5486 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
5487 if (__pyx_t_6 < 0) {
5488 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
5489 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
5490 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
5491 if (unlikely(__pyx_t_7 != -1)) {
5492 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5493 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 212; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5495 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
5504 __pyx_t_8 = __pyx_v_ebN;
5507 if (__pyx_t_8 < 0) {
5508 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5509 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
5510 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
5511 if (__pyx_t_9 < 0) {
5512 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5513 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
5514 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
5515 if (unlikely(__pyx_t_7 != -1)) {
5516 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5517 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 213; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5519 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5528 __pyx_t_10 = __pyx_v_ebN;
5531 if (__pyx_t_10 < 0) {
5532 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
5533 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
5534 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
5535 if (__pyx_t_11 < 0) {
5536 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
5537 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
5538 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
5539 if (unlikely(__pyx_t_7 != -1)) {
5540 __Pyx_RaiseBufferIndexError(__pyx_t_7);
5541 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 214; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5543 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
5552 __pyx_t_12 = (__pyx_v_x->dimensions[2]);
5553 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
5554 __pyx_v_k = __pyx_t_7;
5563 if (unlikely(__pyx_v_material_functions == Py_None)) {
5564 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5565 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5567 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5568 __Pyx_GOTREF(__pyx_t_14);
5569 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5570 __Pyx_GOTREF(__pyx_t_15);
5571 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5572 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5573 __Pyx_GOTREF(__pyx_t_14);
5574 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5575 __Pyx_GOTREF(__pyx_t_16);
5576 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5577 __Pyx_GOTREF(__pyx_t_17);
5578 __pyx_t_18 = PyTuple_New(3);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5579 __Pyx_GOTREF(__pyx_t_18);
5580 __Pyx_GIVEREF(__pyx_t_14);
5581 PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_14);
5582 __Pyx_GIVEREF(__pyx_t_16);
5583 PyTuple_SET_ITEM(__pyx_t_18, 1, __pyx_t_16);
5584 __Pyx_GIVEREF(__pyx_t_17);
5585 PyTuple_SET_ITEM(__pyx_t_18, 2, __pyx_t_17);
5589 __pyx_t_17 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_18);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5590 __Pyx_GOTREF(__pyx_t_17);
5591 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5592 __pyx_t_18 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5593 __Pyx_GOTREF(__pyx_t_18);
5596 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
5597 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_15);
5598 if (likely(__pyx_t_16)) {
5599 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
5600 __Pyx_INCREF(__pyx_t_16);
5601 __Pyx_INCREF(
function);
5602 __Pyx_DECREF_SET(__pyx_t_15,
function);
5606 __pyx_t_14 = PyTuple_New(2+__pyx_t_19);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5607 __Pyx_GOTREF(__pyx_t_14);
5609 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_16); __pyx_t_16 = NULL;
5611 __Pyx_GIVEREF(__pyx_t_17);
5612 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_19, __pyx_t_17);
5613 __Pyx_GIVEREF(__pyx_t_18);
5614 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_19, __pyx_t_18);
5617 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5618 __Pyx_GOTREF(__pyx_t_13);
5619 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5620 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5629 if (unlikely(__pyx_v_material_functions == Py_None)) {
5630 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
5631 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5633 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5634 __Pyx_GOTREF(__pyx_t_14);
5635 __pyx_t_18 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5636 __Pyx_GOTREF(__pyx_t_18);
5637 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5638 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5639 __Pyx_GOTREF(__pyx_t_14);
5640 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5641 __Pyx_GOTREF(__pyx_t_17);
5642 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5643 __Pyx_GOTREF(__pyx_t_16);
5644 __pyx_t_20 = PyTuple_New(3);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5645 __Pyx_GOTREF(__pyx_t_20);
5646 __Pyx_GIVEREF(__pyx_t_14);
5647 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_14);
5648 __Pyx_GIVEREF(__pyx_t_17);
5649 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_17);
5650 __Pyx_GIVEREF(__pyx_t_16);
5651 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_16);
5655 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
5656 __Pyx_GOTREF(__pyx_t_16);
5657 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
5658 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5659 __Pyx_GOTREF(__pyx_t_20);
5662 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_18))) {
5663 __pyx_t_17 = PyMethod_GET_SELF(__pyx_t_18);
5664 if (likely(__pyx_t_17)) {
5665 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_18);
5666 __Pyx_INCREF(__pyx_t_17);
5667 __Pyx_INCREF(
function);
5668 __Pyx_DECREF_SET(__pyx_t_18,
function);
5672 __pyx_t_14 = PyTuple_New(2+__pyx_t_19);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5673 __Pyx_GOTREF(__pyx_t_14);
5675 __Pyx_GIVEREF(__pyx_t_17); PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_17); __pyx_t_17 = NULL;
5677 __Pyx_GIVEREF(__pyx_t_16);
5678 PyTuple_SET_ITEM(__pyx_t_14, 0+__pyx_t_19, __pyx_t_16);
5679 __Pyx_GIVEREF(__pyx_t_20);
5680 PyTuple_SET_ITEM(__pyx_t_14, 1+__pyx_t_19, __pyx_t_20);
5683 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_18, __pyx_t_14, NULL);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 217; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5684 __Pyx_GOTREF(__pyx_t_15);
5685 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
5686 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5695 __pyx_t_18 = PyNumber_Add(__pyx_t_13, __pyx_t_15);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5696 __Pyx_GOTREF(__pyx_t_18);
5697 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
5698 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5699 __pyx_t_15 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_18);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5700 __Pyx_GOTREF(__pyx_t_15);
5701 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
5702 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_15);
if (unlikely((__pyx_t_21 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5703 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
5704 __pyx_t_22 = __pyx_v_eN;
5705 __pyx_t_23 = __pyx_v_ebN_local;
5706 __pyx_t_24 = __pyx_v_k;
5708 if (__pyx_t_22 < 0) {
5709 __pyx_t_22 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
5710 if (unlikely(__pyx_t_22 < 0)) __pyx_t_25 = 0;
5711 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_25 = 0;
5712 if (__pyx_t_23 < 0) {
5713 __pyx_t_23 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
5714 if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 1;
5715 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_25 = 1;
5716 if (__pyx_t_24 < 0) {
5717 __pyx_t_24 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
5718 if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 2;
5719 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_25 = 2;
5720 if (unlikely(__pyx_t_25 != -1)) {
5721 __Pyx_RaiseBufferIndexError(__pyx_t_25);
5722 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5724 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_vals.diminfo[2].strides) = __pyx_t_21;
5738 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5741 __Pyx_XDECREF(__pyx_t_13);
5742 __Pyx_XDECREF(__pyx_t_14);
5743 __Pyx_XDECREF(__pyx_t_15);
5744 __Pyx_XDECREF(__pyx_t_16);
5745 __Pyx_XDECREF(__pyx_t_17);
5746 __Pyx_XDECREF(__pyx_t_18);
5747 __Pyx_XDECREF(__pyx_t_20);
5748 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
5749 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
5750 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
5751 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5752 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5754 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
5755 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5759 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
5760 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
5761 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
5762 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
5764 __Pyx_XGIVEREF(__pyx_r);
5765 __Pyx_RefNannyFinishContext();
5778 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
5779 static char __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
5780 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage};
5781 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5784 PyArrayObject *__pyx_v_elementBoundariesArray = 0;
5785 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
5786 PyArrayObject *__pyx_v_x = 0;
5787 PyArrayObject *__pyx_v_ebq_vals = 0;
5788 PyObject *__pyx_v_material_functions = 0;
5789 int __pyx_lineno = 0;
5790 const char *__pyx_filename = NULL;
5791 int __pyx_clineno = 0;
5792 PyObject *__pyx_r = 0;
5793 __Pyx_RefNannyDeclarations
5794 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage (wrapper)", 0);
5796 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_vals,&__pyx_n_s_material_functions,0};
5797 PyObject* values[7] = {0,0,0,0,0,0,0};
5798 if (unlikely(__pyx_kwds)) {
5800 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5802 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5803 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5804 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5805 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5806 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5807 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5808 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5810 default:
goto __pyx_L5_argtuple_error;
5812 kw_args = PyDict_Size(__pyx_kwds);
5815 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
5816 else goto __pyx_L5_argtuple_error;
5818 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
5820 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5823 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
5825 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5828 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
5830 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5833 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
5835 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5838 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_vals)) != 0)) kw_args--;
5840 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5843 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
5845 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5848 if (unlikely(kw_args > 0)) {
5849 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5851 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
5852 goto __pyx_L5_argtuple_error;
5854 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5855 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5856 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
5857 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
5858 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
5859 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
5860 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
5862 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5863 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 220; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5864 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
5865 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
5866 __pyx_v_x = ((PyArrayObject *)values[4]);
5867 __pyx_v_ebq_vals = ((PyArrayObject *)values[5]);
5868 __pyx_v_material_functions = ((PyObject*)values[6]);
5870 goto __pyx_L4_argument_unpacking_done;
5871 __pyx_L5_argtuple_error:;
5872 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
5874 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
5875 __Pyx_RefNannyFinishContext();
5877 __pyx_L4_argument_unpacking_done:;
5878 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 221; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5879 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 222; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5880 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 223; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5881 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5882 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 225; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5883 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_vals, __pyx_v_material_functions);
5890 __Pyx_RefNannyFinishContext();
5894 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_22evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_vals, PyObject *__pyx_v_material_functions) {
5897 int __pyx_v_ebN_local;
5899 int __pyx_v_material_left;
5900 int __pyx_v_material_right;
5903 double __pyx_v_numer;
5904 double __pyx_v_denom;
5905 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_vals;
5906 __Pyx_Buffer __pyx_pybuffer_ebq_vals;
5907 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
5908 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
5909 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
5910 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
5911 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
5912 __Pyx_Buffer __pyx_pybuffer_x;
5913 PyObject *__pyx_r = NULL;
5914 __Pyx_RefNannyDeclarations
5919 Py_ssize_t __pyx_t_5;
5920 Py_ssize_t __pyx_t_6;
5922 Py_ssize_t __pyx_t_8;
5923 Py_ssize_t __pyx_t_9;
5924 Py_ssize_t __pyx_t_10;
5925 Py_ssize_t __pyx_t_11;
5926 npy_intp __pyx_t_12;
5931 PyObject *__pyx_t_17 = NULL;
5932 PyObject *__pyx_t_18 = NULL;
5933 PyObject *__pyx_t_19 = NULL;
5934 PyObject *__pyx_t_20 = NULL;
5935 PyObject *__pyx_t_21 = NULL;
5936 PyObject *__pyx_t_22 = NULL;
5937 Py_ssize_t __pyx_t_23;
5938 PyObject *__pyx_t_24 = NULL;
5940 Py_ssize_t __pyx_t_26;
5941 Py_ssize_t __pyx_t_27;
5942 Py_ssize_t __pyx_t_28;
5943 Py_ssize_t __pyx_t_29;
5945 int __pyx_lineno = 0;
5946 const char *__pyx_filename = NULL;
5947 int __pyx_clineno = 0;
5948 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", 0);
5949 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
5950 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
5951 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
5952 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
5953 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
5954 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
5955 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
5956 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
5957 __pyx_pybuffer_x.pybuffer.buf = NULL;
5958 __pyx_pybuffer_x.refcount = 0;
5959 __pyx_pybuffernd_x.data = NULL;
5960 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
5961 __pyx_pybuffer_ebq_vals.pybuffer.buf = NULL;
5962 __pyx_pybuffer_ebq_vals.refcount = 0;
5963 __pyx_pybuffernd_ebq_vals.data = NULL;
5964 __pyx_pybuffernd_ebq_vals.rcbuffer = &__pyx_pybuffer_ebq_vals;
5966 __Pyx_BufFmt_StackElem __pyx_stack[1];
5967 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5969 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
5971 __Pyx_BufFmt_StackElem __pyx_stack[1];
5972 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5974 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
5976 __Pyx_BufFmt_StackElem __pyx_stack[1];
5977 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5979 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
5981 __Pyx_BufFmt_StackElem __pyx_stack[1];
5982 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
5984 __pyx_pybuffernd_ebq_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_ebq_vals.diminfo[3].strides = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_ebq_vals.diminfo[3].shape = __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.shape[3];
5993 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
5994 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
5995 __pyx_v_eN = __pyx_t_2;
6004 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
6005 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
6006 __pyx_v_ebN_local = __pyx_t_4;
6015 __pyx_t_5 = __pyx_v_eN;
6016 __pyx_t_6 = __pyx_v_ebN_local;
6018 if (__pyx_t_5 < 0) {
6019 __pyx_t_5 += __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape;
6020 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
6021 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape)) __pyx_t_7 = 0;
6022 if (__pyx_t_6 < 0) {
6023 __pyx_t_6 += __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape;
6024 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
6025 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape)) __pyx_t_7 = 1;
6026 if (unlikely(__pyx_t_7 != -1)) {
6027 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6028 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6030 __pyx_v_ebN = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides));
6039 __pyx_t_8 = __pyx_v_ebN;
6042 if (__pyx_t_8 < 0) {
6043 __pyx_t_8 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6044 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
6045 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
6046 if (__pyx_t_9 < 0) {
6047 __pyx_t_9 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6048 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
6049 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
6050 if (unlikely(__pyx_t_7 != -1)) {
6051 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6052 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 239; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6054 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6063 __pyx_t_10 = __pyx_v_ebN;
6066 if (__pyx_t_10 < 0) {
6067 __pyx_t_10 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6068 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
6069 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_7 = 0;
6070 if (__pyx_t_11 < 0) {
6071 __pyx_t_11 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6072 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
6073 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_7 = 1;
6074 if (unlikely(__pyx_t_7 != -1)) {
6075 __Pyx_RaiseBufferIndexError(__pyx_t_7);
6076 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6078 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6087 __pyx_t_12 = (__pyx_v_x->dimensions[2]);
6088 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
6089 __pyx_v_k = __pyx_t_7;
6098 __pyx_t_13 = __pyx_v_nd;
6099 for (__pyx_t_14 = 0; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6100 __pyx_v_I = __pyx_t_14;
6109 __pyx_t_15 = __pyx_v_nd;
6110 for (__pyx_t_16 = 0; __pyx_t_16 < __pyx_t_15; __pyx_t_16+=1) {
6111 __pyx_v_J = __pyx_t_16;
6120 if (unlikely(__pyx_v_material_functions == Py_None)) {
6121 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6122 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6124 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6125 __Pyx_GOTREF(__pyx_t_18);
6126 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_18);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6127 __Pyx_GOTREF(__pyx_t_19);
6128 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6129 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6130 __Pyx_GOTREF(__pyx_t_18);
6131 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6132 __Pyx_GOTREF(__pyx_t_20);
6133 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6134 __Pyx_GOTREF(__pyx_t_21);
6135 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6136 __Pyx_GOTREF(__pyx_t_22);
6137 __Pyx_GIVEREF(__pyx_t_18);
6138 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_18);
6139 __Pyx_GIVEREF(__pyx_t_20);
6140 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_20);
6141 __Pyx_GIVEREF(__pyx_t_21);
6142 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_t_21);
6146 __pyx_t_21 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_22);
if (unlikely(__pyx_t_21 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6147 __Pyx_GOTREF(__pyx_t_21);
6148 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6149 __pyx_t_22 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6150 __Pyx_GOTREF(__pyx_t_22);
6153 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_19))) {
6154 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_19);
6155 if (likely(__pyx_t_20)) {
6156 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
6157 __Pyx_INCREF(__pyx_t_20);
6158 __Pyx_INCREF(
function);
6159 __Pyx_DECREF_SET(__pyx_t_19,
function);
6163 __pyx_t_18 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6164 __Pyx_GOTREF(__pyx_t_18);
6166 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_18, 0, __pyx_t_20); __pyx_t_20 = NULL;
6168 __Pyx_GIVEREF(__pyx_t_21);
6169 PyTuple_SET_ITEM(__pyx_t_18, 0+__pyx_t_23, __pyx_t_21);
6170 __Pyx_GIVEREF(__pyx_t_22);
6171 PyTuple_SET_ITEM(__pyx_t_18, 1+__pyx_t_23, __pyx_t_22);
6174 __pyx_t_17 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_18, NULL);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6175 __Pyx_GOTREF(__pyx_t_17);
6176 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6177 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6178 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6179 __Pyx_GOTREF(__pyx_t_19);
6180 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6181 __Pyx_GOTREF(__pyx_t_18);
6182 __pyx_t_22 = PyTuple_New(2);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6183 __Pyx_GOTREF(__pyx_t_22);
6184 __Pyx_GIVEREF(__pyx_t_19);
6185 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_19);
6186 __Pyx_GIVEREF(__pyx_t_18);
6187 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_18);
6190 __pyx_t_18 = PyObject_GetItem(__pyx_t_17, __pyx_t_22);
if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6191 __Pyx_GOTREF(__pyx_t_18);
6192 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6193 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6194 __pyx_t_22 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_18);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6195 __Pyx_GOTREF(__pyx_t_22);
6196 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6197 if (unlikely(__pyx_v_material_functions == Py_None)) {
6198 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6199 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6201 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6202 __Pyx_GOTREF(__pyx_t_17);
6203 __pyx_t_19 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6204 __Pyx_GOTREF(__pyx_t_19);
6205 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6206 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6207 __Pyx_GOTREF(__pyx_t_17);
6208 __pyx_t_21 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6209 __Pyx_GOTREF(__pyx_t_21);
6210 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6211 __Pyx_GOTREF(__pyx_t_20);
6212 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6213 __Pyx_GOTREF(__pyx_t_24);
6214 __Pyx_GIVEREF(__pyx_t_17);
6215 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_17);
6216 __Pyx_GIVEREF(__pyx_t_21);
6217 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_21);
6218 __Pyx_GIVEREF(__pyx_t_20);
6219 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_t_20);
6223 __pyx_t_20 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_24);
if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6224 __Pyx_GOTREF(__pyx_t_20);
6225 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6226 __pyx_t_24 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6227 __Pyx_GOTREF(__pyx_t_24);
6230 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_19))) {
6231 __pyx_t_21 = PyMethod_GET_SELF(__pyx_t_19);
6232 if (likely(__pyx_t_21)) {
6233 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_19);
6234 __Pyx_INCREF(__pyx_t_21);
6235 __Pyx_INCREF(
function);
6236 __Pyx_DECREF_SET(__pyx_t_19,
function);
6240 __pyx_t_17 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6241 __Pyx_GOTREF(__pyx_t_17);
6243 __Pyx_GIVEREF(__pyx_t_21); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_21); __pyx_t_21 = NULL;
6245 __Pyx_GIVEREF(__pyx_t_20);
6246 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_23, __pyx_t_20);
6247 __Pyx_GIVEREF(__pyx_t_24);
6248 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_23, __pyx_t_24);
6251 __pyx_t_18 = __Pyx_PyObject_Call(__pyx_t_19, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6252 __Pyx_GOTREF(__pyx_t_18);
6253 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6254 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
6255 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6256 __Pyx_GOTREF(__pyx_t_19);
6257 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6258 __Pyx_GOTREF(__pyx_t_17);
6259 __pyx_t_24 = PyTuple_New(2);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6260 __Pyx_GOTREF(__pyx_t_24);
6261 __Pyx_GIVEREF(__pyx_t_19);
6262 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_19);
6263 __Pyx_GIVEREF(__pyx_t_17);
6264 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_17);
6267 __pyx_t_17 = PyObject_GetItem(__pyx_t_18, __pyx_t_24);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6268 __Pyx_GOTREF(__pyx_t_17);
6269 __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
6270 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6271 __pyx_t_24 = PyNumber_Multiply(__pyx_t_22, __pyx_t_17);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6272 __Pyx_GOTREF(__pyx_t_24);
6273 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6274 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6275 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_24);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6276 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6277 __pyx_v_numer = __pyx_t_25;
6286 if (unlikely(__pyx_v_material_functions == Py_None)) {
6287 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6288 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6290 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6291 __Pyx_GOTREF(__pyx_t_17);
6292 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_17);
if (unlikely(__pyx_t_22 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6293 __Pyx_GOTREF(__pyx_t_22);
6294 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6295 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6296 __Pyx_GOTREF(__pyx_t_17);
6297 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6298 __Pyx_GOTREF(__pyx_t_18);
6299 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6300 __Pyx_GOTREF(__pyx_t_19);
6301 __pyx_t_20 = PyTuple_New(3);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6302 __Pyx_GOTREF(__pyx_t_20);
6303 __Pyx_GIVEREF(__pyx_t_17);
6304 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
6305 __Pyx_GIVEREF(__pyx_t_18);
6306 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_18);
6307 __Pyx_GIVEREF(__pyx_t_19);
6308 PyTuple_SET_ITEM(__pyx_t_20, 2, __pyx_t_19);
6312 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6313 __Pyx_GOTREF(__pyx_t_19);
6314 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6315 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6316 __Pyx_GOTREF(__pyx_t_20);
6319 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_22))) {
6320 __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_22);
6321 if (likely(__pyx_t_18)) {
6322 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_22);
6323 __Pyx_INCREF(__pyx_t_18);
6324 __Pyx_INCREF(
function);
6325 __Pyx_DECREF_SET(__pyx_t_22,
function);
6329 __pyx_t_17 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6330 __Pyx_GOTREF(__pyx_t_17);
6332 __Pyx_GIVEREF(__pyx_t_18); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_18); __pyx_t_18 = NULL;
6334 __Pyx_GIVEREF(__pyx_t_19);
6335 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_23, __pyx_t_19);
6336 __Pyx_GIVEREF(__pyx_t_20);
6337 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_23, __pyx_t_20);
6340 __pyx_t_24 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6341 __Pyx_GOTREF(__pyx_t_24);
6342 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6343 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6344 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6345 __Pyx_GOTREF(__pyx_t_22);
6346 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6347 __Pyx_GOTREF(__pyx_t_17);
6348 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6349 __Pyx_GOTREF(__pyx_t_20);
6350 __Pyx_GIVEREF(__pyx_t_22);
6351 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_22);
6352 __Pyx_GIVEREF(__pyx_t_17);
6353 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_17);
6356 __pyx_t_17 = PyObject_GetItem(__pyx_t_24, __pyx_t_20);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6357 __Pyx_GOTREF(__pyx_t_17);
6358 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6359 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6360 if (unlikely(__pyx_v_material_functions == Py_None)) {
6361 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6362 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6364 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6365 __Pyx_GOTREF(__pyx_t_24);
6366 __pyx_t_22 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_24);
if (unlikely(__pyx_t_22 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6367 __Pyx_GOTREF(__pyx_t_22);
6368 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6369 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6370 __Pyx_GOTREF(__pyx_t_24);
6371 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_ebN_local);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6372 __Pyx_GOTREF(__pyx_t_19);
6373 __pyx_t_18 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6374 __Pyx_GOTREF(__pyx_t_18);
6375 __pyx_t_21 = PyTuple_New(3);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6376 __Pyx_GOTREF(__pyx_t_21);
6377 __Pyx_GIVEREF(__pyx_t_24);
6378 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_24);
6379 __Pyx_GIVEREF(__pyx_t_19);
6380 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_19);
6381 __Pyx_GIVEREF(__pyx_t_18);
6382 PyTuple_SET_ITEM(__pyx_t_21, 2, __pyx_t_18);
6386 __pyx_t_18 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_21);
if (unlikely(__pyx_t_18 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6387 __Pyx_GOTREF(__pyx_t_18);
6388 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6389 __pyx_t_21 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6390 __Pyx_GOTREF(__pyx_t_21);
6393 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_22))) {
6394 __pyx_t_19 = PyMethod_GET_SELF(__pyx_t_22);
6395 if (likely(__pyx_t_19)) {
6396 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_22);
6397 __Pyx_INCREF(__pyx_t_19);
6398 __Pyx_INCREF(
function);
6399 __Pyx_DECREF_SET(__pyx_t_22,
function);
6403 __pyx_t_24 = PyTuple_New(2+__pyx_t_23);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6404 __Pyx_GOTREF(__pyx_t_24);
6406 __Pyx_GIVEREF(__pyx_t_19); PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_19); __pyx_t_19 = NULL;
6408 __Pyx_GIVEREF(__pyx_t_18);
6409 PyTuple_SET_ITEM(__pyx_t_24, 0+__pyx_t_23, __pyx_t_18);
6410 __Pyx_GIVEREF(__pyx_t_21);
6411 PyTuple_SET_ITEM(__pyx_t_24, 1+__pyx_t_23, __pyx_t_21);
6414 __pyx_t_20 = __Pyx_PyObject_Call(__pyx_t_22, __pyx_t_24, NULL);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6415 __Pyx_GOTREF(__pyx_t_20);
6416 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6417 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
6418 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6419 __Pyx_GOTREF(__pyx_t_22);
6420 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6421 __Pyx_GOTREF(__pyx_t_24);
6422 __pyx_t_21 = PyTuple_New(2);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6423 __Pyx_GOTREF(__pyx_t_21);
6424 __Pyx_GIVEREF(__pyx_t_22);
6425 PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_22);
6426 __Pyx_GIVEREF(__pyx_t_24);
6427 PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_24);
6430 __pyx_t_24 = PyObject_GetItem(__pyx_t_20, __pyx_t_21);
if (unlikely(__pyx_t_24 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6431 __Pyx_GOTREF(__pyx_t_24);
6432 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
6433 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6434 __pyx_t_21 = PyNumber_Add(__pyx_t_17, __pyx_t_24);
if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6435 __Pyx_GOTREF(__pyx_t_21);
6436 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6437 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6438 __pyx_t_24 = __Pyx_PyFloat_AddObjC(__pyx_t_21, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6439 __Pyx_GOTREF(__pyx_t_24);
6440 __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
6441 __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_24);
if (unlikely((__pyx_t_25 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6442 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
6443 __pyx_v_denom = __pyx_t_25;
6452 if (unlikely(__pyx_v_denom == 0)) {
6453 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
6454 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6456 __pyx_t_26 = __pyx_v_eN;
6457 __pyx_t_27 = __pyx_v_ebN_local;
6458 __pyx_t_28 = __pyx_v_k;
6459 __pyx_t_29 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
6461 if (__pyx_t_26 < 0) {
6462 __pyx_t_26 += __pyx_pybuffernd_ebq_vals.diminfo[0].shape;
6463 if (unlikely(__pyx_t_26 < 0)) __pyx_t_30 = 0;
6464 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_ebq_vals.diminfo[0].shape)) __pyx_t_30 = 0;
6465 if (__pyx_t_27 < 0) {
6466 __pyx_t_27 += __pyx_pybuffernd_ebq_vals.diminfo[1].shape;
6467 if (unlikely(__pyx_t_27 < 0)) __pyx_t_30 = 1;
6468 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_ebq_vals.diminfo[1].shape)) __pyx_t_30 = 1;
6469 if (__pyx_t_28 < 0) {
6470 __pyx_t_28 += __pyx_pybuffernd_ebq_vals.diminfo[2].shape;
6471 if (unlikely(__pyx_t_28 < 0)) __pyx_t_30 = 2;
6472 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_ebq_vals.diminfo[2].shape)) __pyx_t_30 = 2;
6473 if (__pyx_t_29 < 0) {
6474 __pyx_t_29 += __pyx_pybuffernd_ebq_vals.diminfo[3].shape;
6475 if (unlikely(__pyx_t_29 < 0)) __pyx_t_30 = 3;
6476 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_ebq_vals.diminfo[3].shape)) __pyx_t_30 = 3;
6477 if (unlikely(__pyx_t_30 != -1)) {
6478 __Pyx_RaiseBufferIndexError(__pyx_t_30);
6479 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 246; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6481 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_ebq_vals.diminfo[0].strides, __pyx_t_27, __pyx_pybuffernd_ebq_vals.diminfo[1].strides, __pyx_t_28, __pyx_pybuffernd_ebq_vals.diminfo[2].strides, __pyx_t_29, __pyx_pybuffernd_ebq_vals.diminfo[3].strides) = (__pyx_v_numer / __pyx_v_denom);
6497 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6500 __Pyx_XDECREF(__pyx_t_17);
6501 __Pyx_XDECREF(__pyx_t_18);
6502 __Pyx_XDECREF(__pyx_t_19);
6503 __Pyx_XDECREF(__pyx_t_20);
6504 __Pyx_XDECREF(__pyx_t_21);
6505 __Pyx_XDECREF(__pyx_t_22);
6506 __Pyx_XDECREF(__pyx_t_24);
6507 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6508 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6509 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6510 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6511 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6512 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6513 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6514 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6518 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_vals.rcbuffer->pybuffer);
6519 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6520 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6521 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6523 __Pyx_XGIVEREF(__pyx_r);
6524 __Pyx_RefNannyFinishContext();
6537 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6538 static char __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage[] =
"\n loop over quadrature array and evaluate function f(x,t) = 0.5(f^L_j(x,t)+f^R_k(x,t)) assuming element on left \n is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6539 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage = {
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage};
6540 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6542 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
6543 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
6544 PyArrayObject *__pyx_v_x = 0;
6545 PyArrayObject *__pyx_v_ebq_global_vals = 0;
6546 PyObject *__pyx_v_material_functions = 0;
6547 int __pyx_lineno = 0;
6548 const char *__pyx_filename = NULL;
6549 int __pyx_clineno = 0;
6550 PyObject *__pyx_r = 0;
6551 __Pyx_RefNannyDeclarations
6552 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage (wrapper)", 0);
6554 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
6555 PyObject* values[6] = {0,0,0,0,0,0};
6556 if (unlikely(__pyx_kwds)) {
6558 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6560 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6561 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6562 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6563 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6564 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6565 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6567 default:
goto __pyx_L5_argtuple_error;
6569 kw_args = PyDict_Size(__pyx_kwds);
6572 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
6573 else goto __pyx_L5_argtuple_error;
6575 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
6577 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6580 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
6582 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6585 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
6587 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6590 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
6592 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6595 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
6597 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6600 if (unlikely(kw_args > 0)) {
6601 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6603 }
else if (PyTuple_GET_SIZE(__pyx_args) != 6) {
6604 goto __pyx_L5_argtuple_error;
6606 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6607 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6608 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6609 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6610 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6611 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6613 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6614 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[1]);
6615 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[2]);
6616 __pyx_v_x = ((PyArrayObject *)values[3]);
6617 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[4]);
6618 __pyx_v_material_functions = ((PyObject*)values[5]);
6620 goto __pyx_L4_argument_unpacking_done;
6621 __pyx_L5_argtuple_error:;
6622 __Pyx_RaiseArgtupleInvalid(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 1, 6, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
6624 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6625 __Pyx_RefNannyFinishContext();
6627 __pyx_L4_argument_unpacking_done:;
6628 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 249; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6629 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 250; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6630 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 251; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6631 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 252; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6632 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6633 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(__pyx_self, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
6640 __Pyx_RefNannyFinishContext();
6644 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_24evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
6646 int __pyx_v_material_left;
6647 int __pyx_v_material_right;
6649 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
6650 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
6651 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
6652 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
6653 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
6654 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
6655 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
6656 __Pyx_Buffer __pyx_pybuffer_x;
6657 PyObject *__pyx_r = NULL;
6658 __Pyx_RefNannyDeclarations
6661 Py_ssize_t __pyx_t_3;
6662 Py_ssize_t __pyx_t_4;
6664 Py_ssize_t __pyx_t_6;
6665 Py_ssize_t __pyx_t_7;
6668 PyObject *__pyx_t_10 = NULL;
6669 PyObject *__pyx_t_11 = NULL;
6670 PyObject *__pyx_t_12 = NULL;
6671 PyObject *__pyx_t_13 = NULL;
6672 PyObject *__pyx_t_14 = NULL;
6673 Py_ssize_t __pyx_t_15;
6674 PyObject *__pyx_t_16 = NULL;
6675 PyObject *__pyx_t_17 = NULL;
6676 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_18;
6677 Py_ssize_t __pyx_t_19;
6678 Py_ssize_t __pyx_t_20;
6679 int __pyx_lineno = 0;
6680 const char *__pyx_filename = NULL;
6681 int __pyx_clineno = 0;
6682 __Pyx_RefNannySetupContext(
"evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", 0);
6683 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
6684 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
6685 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
6686 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
6687 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
6688 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
6689 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
6690 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
6691 __pyx_pybuffer_x.pybuffer.buf = NULL;
6692 __pyx_pybuffer_x.refcount = 0;
6693 __pyx_pybuffernd_x.data = NULL;
6694 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
6695 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
6696 __pyx_pybuffer_ebq_global_vals.refcount = 0;
6697 __pyx_pybuffernd_ebq_global_vals.data = NULL;
6698 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
6700 __Pyx_BufFmt_StackElem __pyx_stack[1];
6701 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6703 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
6705 __Pyx_BufFmt_StackElem __pyx_stack[1];
6706 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6708 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
6710 __Pyx_BufFmt_StackElem __pyx_stack[1];
6711 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6713 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
6715 __Pyx_BufFmt_StackElem __pyx_stack[1];
6716 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6718 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1];
6727 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
6728 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
6729 __pyx_v_ebN = __pyx_t_2;
6738 __pyx_t_3 = __pyx_v_ebN;
6741 if (__pyx_t_3 < 0) {
6742 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6743 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
6744 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
6745 if (__pyx_t_4 < 0) {
6746 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6747 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
6748 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
6749 if (unlikely(__pyx_t_5 != -1)) {
6750 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6751 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 264; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6753 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6762 __pyx_t_6 = __pyx_v_ebN;
6765 if (__pyx_t_6 < 0) {
6766 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
6767 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
6768 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
6769 if (__pyx_t_7 < 0) {
6770 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
6771 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
6772 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
6773 if (unlikely(__pyx_t_5 != -1)) {
6774 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6775 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 265; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6777 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
6786 __pyx_t_8 = (__pyx_v_x->dimensions[1]);
6787 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
6788 __pyx_v_k = __pyx_t_9;
6797 if (unlikely(__pyx_v_material_functions == Py_None)) {
6798 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6799 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6801 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6802 __Pyx_GOTREF(__pyx_t_11);
6803 __pyx_t_12 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_11);
if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6804 __Pyx_GOTREF(__pyx_t_12);
6805 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6806 __pyx_t_11 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6807 __Pyx_GOTREF(__pyx_t_11);
6808 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6809 __Pyx_GOTREF(__pyx_t_13);
6810 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6811 __Pyx_GOTREF(__pyx_t_14);
6812 __Pyx_GIVEREF(__pyx_t_11);
6813 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_11);
6814 __Pyx_GIVEREF(__pyx_t_13);
6815 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_13);
6818 __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6819 __Pyx_GOTREF(__pyx_t_13);
6820 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6821 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6822 __Pyx_GOTREF(__pyx_t_14);
6825 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_12))) {
6826 __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_12);
6827 if (likely(__pyx_t_11)) {
6828 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_12);
6829 __Pyx_INCREF(__pyx_t_11);
6830 __Pyx_INCREF(
function);
6831 __Pyx_DECREF_SET(__pyx_t_12,
function);
6835 __pyx_t_16 = PyTuple_New(2+__pyx_t_15);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6836 __Pyx_GOTREF(__pyx_t_16);
6838 __Pyx_GIVEREF(__pyx_t_11); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_11); __pyx_t_11 = NULL;
6840 __Pyx_GIVEREF(__pyx_t_13);
6841 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_15, __pyx_t_13);
6842 __Pyx_GIVEREF(__pyx_t_14);
6843 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_15, __pyx_t_14);
6846 __pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_12, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6847 __Pyx_GOTREF(__pyx_t_10);
6848 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6849 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6858 if (unlikely(__pyx_v_material_functions == Py_None)) {
6859 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
6860 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6862 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6863 __Pyx_GOTREF(__pyx_t_16);
6864 __pyx_t_14 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_16);
if (unlikely(__pyx_t_14 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6865 __Pyx_GOTREF(__pyx_t_14);
6866 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
6867 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6868 __Pyx_GOTREF(__pyx_t_16);
6869 __pyx_t_13 = __Pyx_PyInt_From_Py_intptr_t(__pyx_v_k);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6870 __Pyx_GOTREF(__pyx_t_13);
6871 __pyx_t_11 = PyTuple_New(2);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6872 __Pyx_GOTREF(__pyx_t_11);
6873 __Pyx_GIVEREF(__pyx_t_16);
6874 PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_16);
6875 __Pyx_GIVEREF(__pyx_t_13);
6876 PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_13);
6879 __pyx_t_13 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_11);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
6880 __Pyx_GOTREF(__pyx_t_13);
6881 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
6882 __pyx_t_11 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6883 __Pyx_GOTREF(__pyx_t_11);
6886 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_14))) {
6887 __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_14);
6888 if (likely(__pyx_t_16)) {
6889 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_14);
6890 __Pyx_INCREF(__pyx_t_16);
6891 __Pyx_INCREF(
function);
6892 __Pyx_DECREF_SET(__pyx_t_14,
function);
6896 __pyx_t_17 = PyTuple_New(2+__pyx_t_15);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6897 __Pyx_GOTREF(__pyx_t_17);
6899 __Pyx_GIVEREF(__pyx_t_16); PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_16); __pyx_t_16 = NULL;
6901 __Pyx_GIVEREF(__pyx_t_13);
6902 PyTuple_SET_ITEM(__pyx_t_17, 0+__pyx_t_15, __pyx_t_13);
6903 __Pyx_GIVEREF(__pyx_t_11);
6904 PyTuple_SET_ITEM(__pyx_t_17, 1+__pyx_t_15, __pyx_t_11);
6907 __pyx_t_12 = __Pyx_PyObject_Call(__pyx_t_14, __pyx_t_17, NULL);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6908 __Pyx_GOTREF(__pyx_t_12);
6909 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
6910 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6919 __pyx_t_14 = PyNumber_Add(__pyx_t_10, __pyx_t_12);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6920 __Pyx_GOTREF(__pyx_t_14);
6921 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
6922 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6923 __pyx_t_12 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_14);
if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6924 __Pyx_GOTREF(__pyx_t_12);
6925 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
6926 __pyx_t_18 = __pyx_PyFloat_AsDouble(__pyx_t_12);
if (unlikely((__pyx_t_18 == (npy_double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6927 __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
6928 __pyx_t_19 = __pyx_v_ebN;
6929 __pyx_t_20 = __pyx_v_k;
6931 if (__pyx_t_19 < 0) {
6932 __pyx_t_19 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
6933 if (unlikely(__pyx_t_19 < 0)) __pyx_t_5 = 0;
6934 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_5 = 0;
6935 if (__pyx_t_20 < 0) {
6936 __pyx_t_20 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
6937 if (unlikely(__pyx_t_20 < 0)) __pyx_t_5 = 1;
6938 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_5 = 1;
6939 if (unlikely(__pyx_t_5 != -1)) {
6940 __Pyx_RaiseBufferIndexError(__pyx_t_5);
6941 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
6943 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides) = __pyx_t_18;
6956 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
6959 __Pyx_XDECREF(__pyx_t_10);
6960 __Pyx_XDECREF(__pyx_t_11);
6961 __Pyx_XDECREF(__pyx_t_12);
6962 __Pyx_XDECREF(__pyx_t_13);
6963 __Pyx_XDECREF(__pyx_t_14);
6964 __Pyx_XDECREF(__pyx_t_16);
6965 __Pyx_XDECREF(__pyx_t_17);
6966 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
6967 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
6968 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
6969 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6970 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6971 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6972 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
6973 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
6977 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
6978 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
6979 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
6980 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
6982 __Pyx_XGIVEREF(__pyx_r);
6983 __Pyx_RefNannyFinishContext();
6996 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
6997 static char __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage[] =
"\n loop over quadrature array and evaluate function \ten f_{mn}(x,t) = f^L_{j,mn}(x,t)f^R_{k,mn}(x,t)/(f^L_{j,mn}(x,t)+f^R_{k,mn})\n assuming element on left is material j and element on right is material k\n\n likely little improvement right now without correct typing of material_functions\n \n ";
6998 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage = {
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage};
6999 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7002 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray = 0;
7003 PyArrayObject *__pyx_v_elementBoundaryTypes = 0;
7004 PyArrayObject *__pyx_v_x = 0;
7005 PyArrayObject *__pyx_v_ebq_global_vals = 0;
7006 PyObject *__pyx_v_material_functions = 0;
7007 int __pyx_lineno = 0;
7008 const char *__pyx_filename = NULL;
7009 int __pyx_clineno = 0;
7010 PyObject *__pyx_r = 0;
7011 __Pyx_RefNannyDeclarations
7012 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage (wrapper)", 0);
7014 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_nd,&__pyx_n_s_t,&__pyx_n_s_elementBoundariesArray,&__pyx_n_s_elementBoundaryTypes,&__pyx_n_s_x,&__pyx_n_s_ebq_global_vals,&__pyx_n_s_material_functions,0};
7015 PyObject* values[7] = {0,0,0,0,0,0,0};
7016 if (unlikely(__pyx_kwds)) {
7018 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7020 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7021 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7022 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7023 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7024 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7025 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7026 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7028 default:
goto __pyx_L5_argtuple_error;
7030 kw_args = PyDict_Size(__pyx_kwds);
7033 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nd)) != 0)) kw_args--;
7034 else goto __pyx_L5_argtuple_error;
7036 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
7038 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7041 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundariesArray)) != 0)) kw_args--;
7043 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7046 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBoundaryTypes)) != 0)) kw_args--;
7048 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7051 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
7053 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7056 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ebq_global_vals)) != 0)) kw_args--;
7058 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7061 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_material_functions)) != 0)) kw_args--;
7063 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7066 if (unlikely(kw_args > 0)) {
7067 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7069 }
else if (PyTuple_GET_SIZE(__pyx_args) != 7) {
7070 goto __pyx_L5_argtuple_error;
7072 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7073 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7074 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7075 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7076 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7077 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7078 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7080 __pyx_v_nd = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_nd == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7081 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7082 __pyx_v_elementBoundariesArray = ((PyArrayObject *)values[2]);
7083 __pyx_v_elementBoundaryTypes = ((PyArrayObject *)values[3]);
7084 __pyx_v_x = ((PyArrayObject *)values[4]);
7085 __pyx_v_ebq_global_vals = ((PyArrayObject *)values[5]);
7086 __pyx_v_material_functions = ((PyObject*)values[6]);
7088 goto __pyx_L4_argument_unpacking_done;
7089 __pyx_L5_argtuple_error:;
7090 __Pyx_RaiseArgtupleInvalid(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 1, 7, 7, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7092 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7093 __Pyx_RefNannyFinishContext();
7095 __pyx_L4_argument_unpacking_done:;
7096 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundariesArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundariesArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 273; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7097 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBoundaryTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementBoundaryTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 274; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7098 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 275; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7099 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ebq_global_vals), __pyx_ptype_5numpy_ndarray, 1,
"ebq_global_vals", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7100 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_material_functions), (&PyDict_Type), 1,
"material_functions", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 277; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7101 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(__pyx_self, __pyx_v_nd, __pyx_v_t, __pyx_v_elementBoundariesArray, __pyx_v_elementBoundaryTypes, __pyx_v_x, __pyx_v_ebq_global_vals, __pyx_v_material_functions);
7108 __Pyx_RefNannyFinishContext();
7112 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_26evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_nd,
double __pyx_v_t, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBoundariesArray, PyArrayObject *__pyx_v_elementBoundaryTypes, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_ebq_global_vals, PyObject *__pyx_v_material_functions) {
7115 int __pyx_v_material_left;
7116 int __pyx_v_material_right;
7119 double __pyx_v_numer;
7120 double __pyx_v_denom;
7121 __Pyx_LocalBuf_ND __pyx_pybuffernd_ebq_global_vals;
7122 __Pyx_Buffer __pyx_pybuffer_ebq_global_vals;
7123 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundariesArray;
7124 __Pyx_Buffer __pyx_pybuffer_elementBoundariesArray;
7125 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBoundaryTypes;
7126 __Pyx_Buffer __pyx_pybuffer_elementBoundaryTypes;
7127 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
7128 __Pyx_Buffer __pyx_pybuffer_x;
7129 PyObject *__pyx_r = NULL;
7130 __Pyx_RefNannyDeclarations
7133 Py_ssize_t __pyx_t_3;
7134 Py_ssize_t __pyx_t_4;
7136 Py_ssize_t __pyx_t_6;
7137 Py_ssize_t __pyx_t_7;
7143 PyObject *__pyx_t_13 = NULL;
7144 PyObject *__pyx_t_14 = NULL;
7145 PyObject *__pyx_t_15 = NULL;
7146 PyObject *__pyx_t_16 = NULL;
7147 PyObject *__pyx_t_17 = NULL;
7148 Py_ssize_t __pyx_t_18;
7149 PyObject *__pyx_t_19 = NULL;
7150 PyObject *__pyx_t_20 = NULL;
7152 Py_ssize_t __pyx_t_22;
7153 Py_ssize_t __pyx_t_23;
7154 Py_ssize_t __pyx_t_24;
7156 int __pyx_lineno = 0;
7157 const char *__pyx_filename = NULL;
7158 int __pyx_clineno = 0;
7159 __Pyx_RefNannySetupContext(
"evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", 0);
7160 __pyx_pybuffer_elementBoundariesArray.pybuffer.buf = NULL;
7161 __pyx_pybuffer_elementBoundariesArray.refcount = 0;
7162 __pyx_pybuffernd_elementBoundariesArray.data = NULL;
7163 __pyx_pybuffernd_elementBoundariesArray.rcbuffer = &__pyx_pybuffer_elementBoundariesArray;
7164 __pyx_pybuffer_elementBoundaryTypes.pybuffer.buf = NULL;
7165 __pyx_pybuffer_elementBoundaryTypes.refcount = 0;
7166 __pyx_pybuffernd_elementBoundaryTypes.data = NULL;
7167 __pyx_pybuffernd_elementBoundaryTypes.rcbuffer = &__pyx_pybuffer_elementBoundaryTypes;
7168 __pyx_pybuffer_x.pybuffer.buf = NULL;
7169 __pyx_pybuffer_x.refcount = 0;
7170 __pyx_pybuffernd_x.data = NULL;
7171 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
7172 __pyx_pybuffer_ebq_global_vals.pybuffer.buf = NULL;
7173 __pyx_pybuffer_ebq_global_vals.refcount = 0;
7174 __pyx_pybuffernd_ebq_global_vals.data = NULL;
7175 __pyx_pybuffernd_ebq_global_vals.rcbuffer = &__pyx_pybuffer_ebq_global_vals;
7177 __Pyx_BufFmt_StackElem __pyx_stack[1];
7178 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundariesArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7180 __pyx_pybuffernd_elementBoundariesArray.diminfo[0].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[0].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].strides = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundariesArray.diminfo[1].shape = __pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer.shape[1];
7182 __Pyx_BufFmt_StackElem __pyx_stack[1];
7183 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBoundaryTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7185 __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape = __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.shape[1];
7187 __Pyx_BufFmt_StackElem __pyx_stack[1];
7188 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7190 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
7192 __Pyx_BufFmt_StackElem __pyx_stack[1];
7193 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer, (PyObject*)__pyx_v_ebq_global_vals, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7195 __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape = __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.shape[2];
7204 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
7205 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
7206 __pyx_v_ebN = __pyx_t_2;
7215 __pyx_t_3 = __pyx_v_ebN;
7218 if (__pyx_t_3 < 0) {
7219 __pyx_t_3 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7220 if (unlikely(__pyx_t_3 < 0)) __pyx_t_5 = 0;
7221 }
else if (unlikely(__pyx_t_3 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7222 if (__pyx_t_4 < 0) {
7223 __pyx_t_4 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7224 if (unlikely(__pyx_t_4 < 0)) __pyx_t_5 = 1;
7225 }
else if (unlikely(__pyx_t_4 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7226 if (unlikely(__pyx_t_5 != -1)) {
7227 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7228 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 289; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7230 __pyx_v_material_left = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_3, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_4, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7239 __pyx_t_6 = __pyx_v_ebN;
7242 if (__pyx_t_6 < 0) {
7243 __pyx_t_6 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape;
7244 if (unlikely(__pyx_t_6 < 0)) __pyx_t_5 = 0;
7245 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].shape)) __pyx_t_5 = 0;
7246 if (__pyx_t_7 < 0) {
7247 __pyx_t_7 += __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape;
7248 if (unlikely(__pyx_t_7 < 0)) __pyx_t_5 = 1;
7249 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].shape)) __pyx_t_5 = 1;
7250 if (unlikely(__pyx_t_5 != -1)) {
7251 __Pyx_RaiseBufferIndexError(__pyx_t_5);
7252 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7254 __pyx_v_material_right = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_elementBoundaryTypes.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_elementBoundaryTypes.diminfo[1].strides));
7263 __pyx_t_8 = (__pyx_v_x->dimensions[1]);
7264 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_8; __pyx_t_5+=1) {
7265 __pyx_v_k = __pyx_t_5;
7274 __pyx_t_9 = __pyx_v_nd;
7275 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
7276 __pyx_v_I = __pyx_t_10;
7285 __pyx_t_11 = __pyx_v_nd;
7286 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
7287 __pyx_v_J = __pyx_t_12;
7296 if (unlikely(__pyx_v_material_functions == Py_None)) {
7297 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7298 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7300 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7301 __Pyx_GOTREF(__pyx_t_14);
7302 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7303 __Pyx_GOTREF(__pyx_t_15);
7304 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7305 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7306 __Pyx_GOTREF(__pyx_t_14);
7307 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7308 __Pyx_GOTREF(__pyx_t_16);
7309 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7310 __Pyx_GOTREF(__pyx_t_17);
7311 __Pyx_GIVEREF(__pyx_t_14);
7312 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_14);
7313 __Pyx_GIVEREF(__pyx_t_16);
7314 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_16);
7317 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_17);
if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7318 __Pyx_GOTREF(__pyx_t_16);
7319 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7320 __pyx_t_17 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7321 __Pyx_GOTREF(__pyx_t_17);
7324 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
7325 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_15);
7326 if (likely(__pyx_t_14)) {
7327 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
7328 __Pyx_INCREF(__pyx_t_14);
7329 __Pyx_INCREF(
function);
7330 __Pyx_DECREF_SET(__pyx_t_15,
function);
7334 __pyx_t_19 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7335 __Pyx_GOTREF(__pyx_t_19);
7337 __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_19, 0, __pyx_t_14); __pyx_t_14 = NULL;
7339 __Pyx_GIVEREF(__pyx_t_16);
7340 PyTuple_SET_ITEM(__pyx_t_19, 0+__pyx_t_18, __pyx_t_16);
7341 __Pyx_GIVEREF(__pyx_t_17);
7342 PyTuple_SET_ITEM(__pyx_t_19, 1+__pyx_t_18, __pyx_t_17);
7345 __pyx_t_13 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_19, NULL);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7346 __Pyx_GOTREF(__pyx_t_13);
7347 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7348 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7349 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7350 __Pyx_GOTREF(__pyx_t_15);
7351 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7352 __Pyx_GOTREF(__pyx_t_19);
7353 __pyx_t_17 = PyTuple_New(2);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7354 __Pyx_GOTREF(__pyx_t_17);
7355 __Pyx_GIVEREF(__pyx_t_15);
7356 PyTuple_SET_ITEM(__pyx_t_17, 0, __pyx_t_15);
7357 __Pyx_GIVEREF(__pyx_t_19);
7358 PyTuple_SET_ITEM(__pyx_t_17, 1, __pyx_t_19);
7361 __pyx_t_19 = PyObject_GetItem(__pyx_t_13, __pyx_t_17);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7362 __Pyx_GOTREF(__pyx_t_19);
7363 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7364 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7365 __pyx_t_17 = PyNumber_Multiply(__pyx_float_2_0, __pyx_t_19);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7366 __Pyx_GOTREF(__pyx_t_17);
7367 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7368 if (unlikely(__pyx_v_material_functions == Py_None)) {
7369 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7370 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7372 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7373 __Pyx_GOTREF(__pyx_t_13);
7374 __pyx_t_15 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_13);
if (unlikely(__pyx_t_15 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7375 __Pyx_GOTREF(__pyx_t_15);
7376 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7377 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7378 __Pyx_GOTREF(__pyx_t_13);
7379 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7380 __Pyx_GOTREF(__pyx_t_16);
7381 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7382 __Pyx_GOTREF(__pyx_t_14);
7383 __Pyx_GIVEREF(__pyx_t_13);
7384 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_13);
7385 __Pyx_GIVEREF(__pyx_t_16);
7386 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_16);
7389 __pyx_t_16 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_14);
if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7390 __Pyx_GOTREF(__pyx_t_16);
7391 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7392 __pyx_t_14 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7393 __Pyx_GOTREF(__pyx_t_14);
7396 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_15))) {
7397 __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_15);
7398 if (likely(__pyx_t_13)) {
7399 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_15);
7400 __Pyx_INCREF(__pyx_t_13);
7401 __Pyx_INCREF(
function);
7402 __Pyx_DECREF_SET(__pyx_t_15,
function);
7406 __pyx_t_20 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7407 __Pyx_GOTREF(__pyx_t_20);
7409 __Pyx_GIVEREF(__pyx_t_13); PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_13); __pyx_t_13 = NULL;
7411 __Pyx_GIVEREF(__pyx_t_16);
7412 PyTuple_SET_ITEM(__pyx_t_20, 0+__pyx_t_18, __pyx_t_16);
7413 __Pyx_GIVEREF(__pyx_t_14);
7414 PyTuple_SET_ITEM(__pyx_t_20, 1+__pyx_t_18, __pyx_t_14);
7417 __pyx_t_19 = __Pyx_PyObject_Call(__pyx_t_15, __pyx_t_20, NULL);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7418 __Pyx_GOTREF(__pyx_t_19);
7419 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7420 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7421 __pyx_t_15 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7422 __Pyx_GOTREF(__pyx_t_15);
7423 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7424 __Pyx_GOTREF(__pyx_t_20);
7425 __pyx_t_14 = PyTuple_New(2);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7426 __Pyx_GOTREF(__pyx_t_14);
7427 __Pyx_GIVEREF(__pyx_t_15);
7428 PyTuple_SET_ITEM(__pyx_t_14, 0, __pyx_t_15);
7429 __Pyx_GIVEREF(__pyx_t_20);
7430 PyTuple_SET_ITEM(__pyx_t_14, 1, __pyx_t_20);
7433 __pyx_t_20 = PyObject_GetItem(__pyx_t_19, __pyx_t_14);
if (unlikely(__pyx_t_20 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7434 __Pyx_GOTREF(__pyx_t_20);
7435 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
7436 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7437 __pyx_t_14 = PyNumber_Multiply(__pyx_t_17, __pyx_t_20);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7438 __Pyx_GOTREF(__pyx_t_14);
7439 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7440 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7441 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_14);
if (unlikely((__pyx_t_21 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 294; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7442 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7443 __pyx_v_numer = __pyx_t_21;
7452 if (unlikely(__pyx_v_material_functions == Py_None)) {
7453 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7454 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7456 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_material_left);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7457 __Pyx_GOTREF(__pyx_t_20);
7458 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_20);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7459 __Pyx_GOTREF(__pyx_t_17);
7460 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7461 __pyx_t_20 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7462 __Pyx_GOTREF(__pyx_t_20);
7463 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7464 __Pyx_GOTREF(__pyx_t_19);
7465 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7466 __Pyx_GOTREF(__pyx_t_15);
7467 __Pyx_GIVEREF(__pyx_t_20);
7468 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_20);
7469 __Pyx_GIVEREF(__pyx_t_19);
7470 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_19);
7473 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_15);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7474 __Pyx_GOTREF(__pyx_t_19);
7475 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7476 __pyx_t_15 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7477 __Pyx_GOTREF(__pyx_t_15);
7480 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_17))) {
7481 __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_17);
7482 if (likely(__pyx_t_20)) {
7483 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
7484 __Pyx_INCREF(__pyx_t_20);
7485 __Pyx_INCREF(
function);
7486 __Pyx_DECREF_SET(__pyx_t_17,
function);
7490 __pyx_t_16 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7491 __Pyx_GOTREF(__pyx_t_16);
7493 __Pyx_GIVEREF(__pyx_t_20); PyTuple_SET_ITEM(__pyx_t_16, 0, __pyx_t_20); __pyx_t_20 = NULL;
7495 __Pyx_GIVEREF(__pyx_t_19);
7496 PyTuple_SET_ITEM(__pyx_t_16, 0+__pyx_t_18, __pyx_t_19);
7497 __Pyx_GIVEREF(__pyx_t_15);
7498 PyTuple_SET_ITEM(__pyx_t_16, 1+__pyx_t_18, __pyx_t_15);
7501 __pyx_t_14 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_16, NULL);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7502 __Pyx_GOTREF(__pyx_t_14);
7503 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7504 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7505 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7506 __Pyx_GOTREF(__pyx_t_17);
7507 __pyx_t_16 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7508 __Pyx_GOTREF(__pyx_t_16);
7509 __pyx_t_15 = PyTuple_New(2);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7510 __Pyx_GOTREF(__pyx_t_15);
7511 __Pyx_GIVEREF(__pyx_t_17);
7512 PyTuple_SET_ITEM(__pyx_t_15, 0, __pyx_t_17);
7513 __Pyx_GIVEREF(__pyx_t_16);
7514 PyTuple_SET_ITEM(__pyx_t_15, 1, __pyx_t_16);
7517 __pyx_t_16 = PyObject_GetItem(__pyx_t_14, __pyx_t_15);
if (unlikely(__pyx_t_16 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7518 __Pyx_GOTREF(__pyx_t_16);
7519 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7520 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7521 if (unlikely(__pyx_v_material_functions == Py_None)) {
7522 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
7523 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7525 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_material_right);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7526 __Pyx_GOTREF(__pyx_t_14);
7527 __pyx_t_17 = __Pyx_PyDict_GetItem(__pyx_v_material_functions, __pyx_t_14);
if (unlikely(__pyx_t_17 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7528 __Pyx_GOTREF(__pyx_t_17);
7529 __Pyx_DECREF(__pyx_t_14); __pyx_t_14 = 0;
7530 __pyx_t_14 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7531 __Pyx_GOTREF(__pyx_t_14);
7532 __pyx_t_19 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7533 __Pyx_GOTREF(__pyx_t_19);
7534 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7535 __Pyx_GOTREF(__pyx_t_20);
7536 __Pyx_GIVEREF(__pyx_t_14);
7537 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_14);
7538 __Pyx_GIVEREF(__pyx_t_19);
7539 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_19);
7542 __pyx_t_19 = PyObject_GetItem(((PyObject *)__pyx_v_x), __pyx_t_20);
if (unlikely(__pyx_t_19 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7543 __Pyx_GOTREF(__pyx_t_19);
7544 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7545 __pyx_t_20 = PyFloat_FromDouble(__pyx_v_t);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7546 __Pyx_GOTREF(__pyx_t_20);
7549 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_17))) {
7550 __pyx_t_14 = PyMethod_GET_SELF(__pyx_t_17);
7551 if (likely(__pyx_t_14)) {
7552 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_17);
7553 __Pyx_INCREF(__pyx_t_14);
7554 __Pyx_INCREF(
function);
7555 __Pyx_DECREF_SET(__pyx_t_17,
function);
7559 __pyx_t_13 = PyTuple_New(2+__pyx_t_18);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7560 __Pyx_GOTREF(__pyx_t_13);
7562 __Pyx_GIVEREF(__pyx_t_14); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_14); __pyx_t_14 = NULL;
7564 __Pyx_GIVEREF(__pyx_t_19);
7565 PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_18, __pyx_t_19);
7566 __Pyx_GIVEREF(__pyx_t_20);
7567 PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_18, __pyx_t_20);
7570 __pyx_t_15 = __Pyx_PyObject_Call(__pyx_t_17, __pyx_t_13, NULL);
if (unlikely(!__pyx_t_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7571 __Pyx_GOTREF(__pyx_t_15);
7572 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7573 __Pyx_DECREF(__pyx_t_17); __pyx_t_17 = 0;
7574 __pyx_t_17 = __Pyx_PyInt_From_int(__pyx_v_I);
if (unlikely(!__pyx_t_17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7575 __Pyx_GOTREF(__pyx_t_17);
7576 __pyx_t_13 = __Pyx_PyInt_From_int(__pyx_v_J);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7577 __Pyx_GOTREF(__pyx_t_13);
7578 __pyx_t_20 = PyTuple_New(2);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7579 __Pyx_GOTREF(__pyx_t_20);
7580 __Pyx_GIVEREF(__pyx_t_17);
7581 PyTuple_SET_ITEM(__pyx_t_20, 0, __pyx_t_17);
7582 __Pyx_GIVEREF(__pyx_t_13);
7583 PyTuple_SET_ITEM(__pyx_t_20, 1, __pyx_t_13);
7586 __pyx_t_13 = PyObject_GetItem(__pyx_t_15, __pyx_t_20);
if (unlikely(__pyx_t_13 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
7587 __Pyx_GOTREF(__pyx_t_13);
7588 __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
7589 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7590 __pyx_t_20 = PyNumber_Add(__pyx_t_16, __pyx_t_13);
if (unlikely(!__pyx_t_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7591 __Pyx_GOTREF(__pyx_t_20);
7592 __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
7593 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7594 __pyx_t_13 = __Pyx_PyFloat_AddObjC(__pyx_t_20, __pyx_float_1_0eneg_20, 1.0e-20, 0);
if (unlikely(!__pyx_t_13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7595 __Pyx_GOTREF(__pyx_t_13);
7596 __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
7597 __pyx_t_21 = __pyx_PyFloat_AsDouble(__pyx_t_13);
if (unlikely((__pyx_t_21 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 295; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7598 __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
7599 __pyx_v_denom = __pyx_t_21;
7608 if (unlikely(__pyx_v_denom == 0)) {
7609 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
7610 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7612 __pyx_t_22 = __pyx_v_ebN;
7613 __pyx_t_23 = __pyx_v_k;
7614 __pyx_t_24 = ((__pyx_v_I * __pyx_v_nd) + __pyx_v_J);
7616 if (__pyx_t_22 < 0) {
7617 __pyx_t_22 += __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape;
7618 if (unlikely(__pyx_t_22 < 0)) __pyx_t_25 = 0;
7619 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_ebq_global_vals.diminfo[0].shape)) __pyx_t_25 = 0;
7620 if (__pyx_t_23 < 0) {
7621 __pyx_t_23 += __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape;
7622 if (unlikely(__pyx_t_23 < 0)) __pyx_t_25 = 1;
7623 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_ebq_global_vals.diminfo[1].shape)) __pyx_t_25 = 1;
7624 if (__pyx_t_24 < 0) {
7625 __pyx_t_24 += __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape;
7626 if (unlikely(__pyx_t_24 < 0)) __pyx_t_25 = 2;
7627 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_ebq_global_vals.diminfo[2].shape)) __pyx_t_25 = 2;
7628 if (unlikely(__pyx_t_25 != -1)) {
7629 __Pyx_RaiseBufferIndexError(__pyx_t_25);
7630 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 296; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7632 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_ebq_global_vals.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_ebq_global_vals.diminfo[1].strides, __pyx_t_24, __pyx_pybuffernd_ebq_global_vals.diminfo[2].strides) = (__pyx_v_numer / __pyx_v_denom);
7647 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7650 __Pyx_XDECREF(__pyx_t_13);
7651 __Pyx_XDECREF(__pyx_t_14);
7652 __Pyx_XDECREF(__pyx_t_15);
7653 __Pyx_XDECREF(__pyx_t_16);
7654 __Pyx_XDECREF(__pyx_t_17);
7655 __Pyx_XDECREF(__pyx_t_19);
7656 __Pyx_XDECREF(__pyx_t_20);
7657 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
7658 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
7659 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7660 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7661 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7662 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7663 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
7664 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage", __pyx_clineno, __pyx_lineno, __pyx_filename);
7668 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_ebq_global_vals.rcbuffer->pybuffer);
7669 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundariesArray.rcbuffer->pybuffer);
7670 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBoundaryTypes.rcbuffer->pybuffer);
7671 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
7673 __Pyx_XGIVEREF(__pyx_r);
7674 __Pyx_RefNannyFinishContext();
7687 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
7688 static char __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear[] =
"\n routine for evaluating linaer interface (nodal) coefficients in NCP1 approximation for Darcy Flow\n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
7689 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear = {
"RE_NCP1_evaluateElementCoefficients_Linear", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear};
7690 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7692 PyArrayObject *__pyx_v_gravity = 0;
7693 PyArrayObject *__pyx_v_rowptr = 0;
7694 PyArrayObject *__pyx_v_colind = 0;
7695 PyArrayObject *__pyx_v_KWs = 0;
7697 int __pyx_v_nElements_global;
7698 int __pyx_v_nElementBoundaries_element;
7699 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
7700 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
7701 PyArrayObject *__pyx_v_q_flin = 0;
7702 PyArrayObject *__pyx_v_q_alin = 0;
7703 int __pyx_lineno = 0;
7704 const char *__pyx_filename = NULL;
7705 int __pyx_clineno = 0;
7706 PyObject *__pyx_r = 0;
7707 __Pyx_RefNannyDeclarations
7708 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear (wrapper)", 0);
7710 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_KWs,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,0};
7711 PyObject* values[12] = {0,0,0,0,0,0,0,0,0,0,0,0};
7712 if (unlikely(__pyx_kwds)) {
7714 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7716 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7717 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7718 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7719 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7720 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7721 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7722 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7723 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7724 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7725 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7726 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7727 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7729 default:
goto __pyx_L5_argtuple_error;
7731 kw_args = PyDict_Size(__pyx_kwds);
7734 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
7735 else goto __pyx_L5_argtuple_error;
7737 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
7739 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7742 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
7744 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7747 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
7749 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7752 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_KWs)) != 0)) kw_args--;
7754 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7757 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
7759 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7762 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
7764 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7767 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
7769 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7772 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
7774 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7777 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
7779 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7782 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
7784 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7787 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
7789 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7792 if (unlikely(kw_args > 0)) {
7793 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_Linear") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7795 }
else if (PyTuple_GET_SIZE(__pyx_args) != 12) {
7796 goto __pyx_L5_argtuple_error;
7798 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7799 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7800 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7801 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7802 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7803 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7804 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
7805 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
7806 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
7807 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
7808 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
7809 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
7811 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7812 __pyx_v_gravity = ((PyArrayObject *)values[1]);
7813 __pyx_v_rowptr = ((PyArrayObject *)values[2]);
7814 __pyx_v_colind = ((PyArrayObject *)values[3]);
7815 __pyx_v_KWs = ((PyArrayObject *)values[4]);
7816 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 307; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7817 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[6]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7818 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7819 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[8]);
7820 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[9]);
7821 __pyx_v_q_flin = ((PyArrayObject *)values[10]);
7822 __pyx_v_q_alin = ((PyArrayObject *)values[11]);
7824 goto __pyx_L4_argument_unpacking_done;
7825 __pyx_L5_argtuple_error:;
7826 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_Linear", 1, 12, 12, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
7828 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
7829 __Pyx_RefNannyFinishContext();
7831 __pyx_L4_argument_unpacking_done:;
7832 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7833 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7834 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7835 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_KWs), __pyx_ptype_5numpy_ndarray, 1,
"KWs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 305; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7836 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7837 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7838 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7839 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7840 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(__pyx_self, __pyx_v_rho, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_KWs, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementMaterialTypes, __pyx_v_q_flin, __pyx_v_q_alin);
7847 __Pyx_RefNannyFinishContext();
7851 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_28RE_NCP1_evaluateElementCoefficients_Linear(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind, PyArrayObject *__pyx_v_KWs,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementMaterialTypes, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin) {
7853 int __pyx_v_eN_neighbor;
7858 int __pyx_v_matID_neig;
7859 CYTHON_UNUSED
int __pyx_v_nSpace2;
7861 PyArrayObject *__pyx_v_a_eN = 0;
7862 PyArrayObject *__pyx_v_a_neig = 0;
7863 PyArrayObject *__pyx_v_a_avg = 0;
7864 __Pyx_LocalBuf_ND __pyx_pybuffernd_KWs;
7865 __Pyx_Buffer __pyx_pybuffer_KWs;
7866 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_avg;
7867 __Pyx_Buffer __pyx_pybuffer_a_avg;
7868 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_eN;
7869 __Pyx_Buffer __pyx_pybuffer_a_eN;
7870 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_neig;
7871 __Pyx_Buffer __pyx_pybuffer_a_neig;
7872 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
7873 __Pyx_Buffer __pyx_pybuffer_colind;
7874 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
7875 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
7876 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
7877 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
7878 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
7879 __Pyx_Buffer __pyx_pybuffer_gravity;
7880 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
7881 __Pyx_Buffer __pyx_pybuffer_q_alin;
7882 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
7883 __Pyx_Buffer __pyx_pybuffer_q_flin;
7884 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
7885 __Pyx_Buffer __pyx_pybuffer_rowptr;
7886 PyObject *__pyx_r = NULL;
7887 __Pyx_RefNannyDeclarations
7888 Py_ssize_t __pyx_t_1;
7890 PyObject *__pyx_t_3 = NULL;
7891 PyObject *__pyx_t_4 = NULL;
7892 PyObject *__pyx_t_5 = NULL;
7893 PyObject *__pyx_t_6 = NULL;
7894 Py_ssize_t __pyx_t_7;
7895 PyObject *__pyx_t_8 = NULL;
7896 PyArrayObject *__pyx_t_9 = NULL;
7897 PyArrayObject *__pyx_t_10 = NULL;
7898 PyArrayObject *__pyx_t_11 = NULL;
7900 Py_ssize_t __pyx_t_13;
7903 Py_ssize_t __pyx_t_16;
7904 Py_ssize_t __pyx_t_17;
7906 Py_ssize_t __pyx_t_19;
7907 Py_ssize_t __pyx_t_20;
7908 Py_ssize_t __pyx_t_21;
7910 Py_ssize_t __pyx_t_23;
7912 Py_ssize_t __pyx_t_25;
7914 Py_ssize_t __pyx_t_27;
7915 Py_ssize_t __pyx_t_28;
7916 Py_ssize_t __pyx_t_29;
7917 Py_ssize_t __pyx_t_30;
7918 Py_ssize_t __pyx_t_31;
7919 Py_ssize_t __pyx_t_32;
7920 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_33;
7921 Py_ssize_t __pyx_t_34;
7922 Py_ssize_t __pyx_t_35;
7923 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_36;
7924 Py_ssize_t __pyx_t_37;
7925 Py_ssize_t __pyx_t_38;
7926 Py_ssize_t __pyx_t_39;
7927 Py_ssize_t __pyx_t_40;
7928 Py_ssize_t __pyx_t_41;
7929 Py_ssize_t __pyx_t_42;
7930 Py_ssize_t __pyx_t_43;
7931 Py_ssize_t __pyx_t_44;
7932 Py_ssize_t __pyx_t_45;
7933 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_46;
7934 Py_ssize_t __pyx_t_47;
7935 Py_ssize_t __pyx_t_48;
7937 Py_ssize_t __pyx_t_50;
7938 Py_ssize_t __pyx_t_51;
7939 Py_ssize_t __pyx_t_52;
7940 Py_ssize_t __pyx_t_53;
7941 Py_ssize_t __pyx_t_54;
7942 int __pyx_lineno = 0;
7943 const char *__pyx_filename = NULL;
7944 int __pyx_clineno = 0;
7945 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_Linear", 0);
7946 __pyx_pybuffer_a_eN.pybuffer.buf = NULL;
7947 __pyx_pybuffer_a_eN.refcount = 0;
7948 __pyx_pybuffernd_a_eN.data = NULL;
7949 __pyx_pybuffernd_a_eN.rcbuffer = &__pyx_pybuffer_a_eN;
7950 __pyx_pybuffer_a_neig.pybuffer.buf = NULL;
7951 __pyx_pybuffer_a_neig.refcount = 0;
7952 __pyx_pybuffernd_a_neig.data = NULL;
7953 __pyx_pybuffernd_a_neig.rcbuffer = &__pyx_pybuffer_a_neig;
7954 __pyx_pybuffer_a_avg.pybuffer.buf = NULL;
7955 __pyx_pybuffer_a_avg.refcount = 0;
7956 __pyx_pybuffernd_a_avg.data = NULL;
7957 __pyx_pybuffernd_a_avg.rcbuffer = &__pyx_pybuffer_a_avg;
7958 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
7959 __pyx_pybuffer_gravity.refcount = 0;
7960 __pyx_pybuffernd_gravity.data = NULL;
7961 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
7962 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
7963 __pyx_pybuffer_rowptr.refcount = 0;
7964 __pyx_pybuffernd_rowptr.data = NULL;
7965 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
7966 __pyx_pybuffer_colind.pybuffer.buf = NULL;
7967 __pyx_pybuffer_colind.refcount = 0;
7968 __pyx_pybuffernd_colind.data = NULL;
7969 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
7970 __pyx_pybuffer_KWs.pybuffer.buf = NULL;
7971 __pyx_pybuffer_KWs.refcount = 0;
7972 __pyx_pybuffernd_KWs.data = NULL;
7973 __pyx_pybuffernd_KWs.rcbuffer = &__pyx_pybuffer_KWs;
7974 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
7975 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
7976 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
7977 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
7978 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
7979 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
7980 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
7981 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
7982 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
7983 __pyx_pybuffer_q_flin.refcount = 0;
7984 __pyx_pybuffernd_q_flin.data = NULL;
7985 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
7986 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
7987 __pyx_pybuffer_q_alin.refcount = 0;
7988 __pyx_pybuffernd_q_alin.data = NULL;
7989 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
7991 __Pyx_BufFmt_StackElem __pyx_stack[1];
7992 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7994 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
7996 __Pyx_BufFmt_StackElem __pyx_stack[1];
7997 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
7999 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
8001 __Pyx_BufFmt_StackElem __pyx_stack[1];
8002 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8004 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
8006 __Pyx_BufFmt_StackElem __pyx_stack[1];
8007 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer, (PyObject*)__pyx_v_KWs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8009 __pyx_pybuffernd_KWs.diminfo[0].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_KWs.diminfo[0].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_KWs.diminfo[1].strides = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_KWs.diminfo[1].shape = __pyx_pybuffernd_KWs.rcbuffer->pybuffer.shape[1];
8011 __Pyx_BufFmt_StackElem __pyx_stack[1];
8012 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8014 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
8016 __Pyx_BufFmt_StackElem __pyx_stack[1];
8017 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8019 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
8021 __Pyx_BufFmt_StackElem __pyx_stack[1];
8022 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8024 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
8026 __Pyx_BufFmt_StackElem __pyx_stack[1];
8027 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8029 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
8038 __pyx_v_nSpace2 = (__pyx_v_nSpace * __pyx_v_nSpace);
8047 __pyx_t_1 = __pyx_v_nSpace;
8049 if (__pyx_t_1 < 0) {
8050 __pyx_t_1 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
8051 if (unlikely(__pyx_t_1 < 0)) __pyx_t_2 = 0;
8052 }
else if (unlikely(__pyx_t_1 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_2 = 0;
8053 if (unlikely(__pyx_t_2 != -1)) {
8054 __Pyx_RaiseBufferIndexError(__pyx_t_2);
8055 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 329; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8057 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_1, __pyx_pybuffernd_rowptr.diminfo[0].strides));
8066 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8067 __Pyx_GOTREF(__pyx_t_4);
8068 __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8069 __Pyx_GOTREF(__pyx_t_5);
8070 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8071 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8072 __Pyx_GOTREF(__pyx_t_4);
8075 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_5))) {
8076 __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8077 if (likely(__pyx_t_6)) {
8078 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_5);
8079 __Pyx_INCREF(__pyx_t_6);
8080 __Pyx_INCREF(
function);
8081 __Pyx_DECREF_SET(__pyx_t_5,
function);
8085 __pyx_t_8 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8086 __Pyx_GOTREF(__pyx_t_8);
8088 __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
8090 __Pyx_GIVEREF(__pyx_t_4);
8091 PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_4);
8092 __Pyx_INCREF(__pyx_n_s_d);
8093 __Pyx_GIVEREF(__pyx_n_s_d);
8094 PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_n_s_d);
8096 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8097 __Pyx_GOTREF(__pyx_t_3);
8098 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8099 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8100 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8101 __pyx_t_9 = ((PyArrayObject *)__pyx_t_3);
8103 __Pyx_BufFmt_StackElem __pyx_stack[1];
8104 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer, (PyObject*)__pyx_t_9, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8105 __pyx_v_a_eN = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf = NULL;
8106 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 331; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8107 }
else {__pyx_pybuffernd_a_eN.diminfo[0].strides = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_eN.diminfo[0].shape = __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.shape[0];
8111 __pyx_v_a_eN = ((PyArrayObject *)__pyx_t_3);
8121 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8122 __Pyx_GOTREF(__pyx_t_5);
8123 __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8124 __Pyx_GOTREF(__pyx_t_8);
8125 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8126 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8127 __Pyx_GOTREF(__pyx_t_5);
8130 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_8))) {
8131 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
8132 if (likely(__pyx_t_4)) {
8133 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_8);
8134 __Pyx_INCREF(__pyx_t_4);
8135 __Pyx_INCREF(
function);
8136 __Pyx_DECREF_SET(__pyx_t_8,
function);
8140 __pyx_t_6 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8141 __Pyx_GOTREF(__pyx_t_6);
8143 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
8145 __Pyx_GIVEREF(__pyx_t_5);
8146 PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_t_5);
8147 __Pyx_INCREF(__pyx_n_s_d);
8148 __Pyx_GIVEREF(__pyx_n_s_d);
8149 PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_n_s_d);
8151 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_6, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8152 __Pyx_GOTREF(__pyx_t_3);
8153 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8154 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8155 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8156 __pyx_t_10 = ((PyArrayObject *)__pyx_t_3);
8158 __Pyx_BufFmt_StackElem __pyx_stack[1];
8159 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8160 __pyx_v_a_neig = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf = NULL;
8161 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8162 }
else {__pyx_pybuffernd_a_neig.diminfo[0].strides = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_neig.diminfo[0].shape = __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.shape[0];
8166 __pyx_v_a_neig = ((PyArrayObject *)__pyx_t_3);
8176 __pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8177 __Pyx_GOTREF(__pyx_t_8);
8178 __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8179 __Pyx_GOTREF(__pyx_t_6);
8180 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
8181 __pyx_t_8 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8182 __Pyx_GOTREF(__pyx_t_8);
8185 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_6))) {
8186 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
8187 if (likely(__pyx_t_5)) {
8188 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_6);
8189 __Pyx_INCREF(__pyx_t_5);
8190 __Pyx_INCREF(
function);
8191 __Pyx_DECREF_SET(__pyx_t_6,
function);
8195 __pyx_t_4 = PyTuple_New(2+__pyx_t_7);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8196 __Pyx_GOTREF(__pyx_t_4);
8198 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
8200 __Pyx_GIVEREF(__pyx_t_8);
8201 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_t_8);
8202 __Pyx_INCREF(__pyx_n_s_d);
8203 __Pyx_GIVEREF(__pyx_n_s_d);
8204 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_n_s_d);
8206 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8207 __Pyx_GOTREF(__pyx_t_3);
8208 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8209 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8210 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8211 __pyx_t_11 = ((PyArrayObject *)__pyx_t_3);
8213 __Pyx_BufFmt_StackElem __pyx_stack[1];
8214 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
8215 __pyx_v_a_avg = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf = NULL;
8216 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8217 }
else {__pyx_pybuffernd_a_avg.diminfo[0].strides = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_avg.diminfo[0].shape = __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.shape[0];
8221 __pyx_v_a_avg = ((PyArrayObject *)__pyx_t_3);
8231 __pyx_t_2 = __pyx_v_nElements_global;
8232 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_2; __pyx_t_12+=1) {
8233 __pyx_v_eN = __pyx_t_12;
8242 __pyx_t_13 = __pyx_v_eN;
8244 if (__pyx_t_13 < 0) {
8245 __pyx_t_13 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
8246 if (unlikely(__pyx_t_13 < 0)) __pyx_t_14 = 0;
8247 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_14 = 0;
8248 if (unlikely(__pyx_t_14 != -1)) {
8249 __Pyx_RaiseBufferIndexError(__pyx_t_14);
8250 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 337; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8252 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
8261 __pyx_t_14 = __pyx_v_nnz;
8262 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
8263 __pyx_v_ii = __pyx_t_15;
8272 __pyx_t_16 = __pyx_v_matID;
8273 __pyx_t_17 = __pyx_v_ii;
8275 if (__pyx_t_16 < 0) {
8276 __pyx_t_16 += __pyx_pybuffernd_KWs.diminfo[0].shape;
8277 if (unlikely(__pyx_t_16 < 0)) __pyx_t_18 = 0;
8278 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_18 = 0;
8279 if (__pyx_t_17 < 0) {
8280 __pyx_t_17 += __pyx_pybuffernd_KWs.diminfo[1].shape;
8281 if (unlikely(__pyx_t_17 < 0)) __pyx_t_18 = 1;
8282 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_18 = 1;
8283 if (unlikely(__pyx_t_18 != -1)) {
8284 __Pyx_RaiseBufferIndexError(__pyx_t_18);
8285 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8287 __pyx_t_19 = __pyx_v_ii;
8289 if (__pyx_t_19 < 0) {
8290 __pyx_t_19 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8291 if (unlikely(__pyx_t_19 < 0)) __pyx_t_18 = 0;
8292 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_18 = 0;
8293 if (unlikely(__pyx_t_18 != -1)) {
8294 __Pyx_RaiseBufferIndexError(__pyx_t_18);
8295 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 339; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8297 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_a_eN.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_KWs.diminfo[1].strides)));
8307 __pyx_t_14 = __pyx_v_nElementBoundaries_element;
8308 for (__pyx_t_15 = 0; __pyx_t_15 < __pyx_t_14; __pyx_t_15+=1) {
8309 __pyx_v_ebN = __pyx_t_15;
8318 __pyx_t_20 = __pyx_v_eN;
8319 __pyx_t_21 = __pyx_v_ebN;
8321 if (__pyx_t_20 < 0) {
8322 __pyx_t_20 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
8323 if (unlikely(__pyx_t_20 < 0)) __pyx_t_18 = 0;
8324 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_18 = 0;
8325 if (__pyx_t_21 < 0) {
8326 __pyx_t_21 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
8327 if (unlikely(__pyx_t_21 < 0)) __pyx_t_18 = 1;
8328 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_18 = 1;
8329 if (unlikely(__pyx_t_18 != -1)) {
8330 __Pyx_RaiseBufferIndexError(__pyx_t_18);
8331 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 341; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8333 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
8342 __pyx_t_18 = __pyx_v_nnz;
8343 for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_18; __pyx_t_22+=1) {
8344 __pyx_v_ii = __pyx_t_22;
8353 __pyx_t_23 = __pyx_v_ii;
8355 if (__pyx_t_23 < 0) {
8356 __pyx_t_23 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8357 if (unlikely(__pyx_t_23 < 0)) __pyx_t_24 = 0;
8358 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_24 = 0;
8359 if (unlikely(__pyx_t_24 != -1)) {
8360 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8361 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8363 __pyx_t_25 = __pyx_v_ii;
8365 if (__pyx_t_25 < 0) {
8366 __pyx_t_25 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
8367 if (unlikely(__pyx_t_25 < 0)) __pyx_t_24 = 0;
8368 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_24 = 0;
8369 if (unlikely(__pyx_t_24 != -1)) {
8370 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8371 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 343; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8373 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_a_eN.diminfo[0].strides));
8383 __pyx_t_26 = ((__pyx_v_eN_neighbor >= 0) != 0);
8393 __pyx_t_27 = __pyx_v_eN_neighbor;
8395 if (__pyx_t_27 < 0) {
8396 __pyx_t_27 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
8397 if (unlikely(__pyx_t_27 < 0)) __pyx_t_18 = 0;
8398 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_18 = 0;
8399 if (unlikely(__pyx_t_18 != -1)) {
8400 __Pyx_RaiseBufferIndexError(__pyx_t_18);
8401 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 345; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8403 __pyx_v_matID_neig = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
8412 __pyx_t_18 = __pyx_v_nnz;
8413 for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_18; __pyx_t_22+=1) {
8414 __pyx_v_ii = __pyx_t_22;
8423 __pyx_t_28 = __pyx_v_matID_neig;
8424 __pyx_t_29 = __pyx_v_ii;
8426 if (__pyx_t_28 < 0) {
8427 __pyx_t_28 += __pyx_pybuffernd_KWs.diminfo[0].shape;
8428 if (unlikely(__pyx_t_28 < 0)) __pyx_t_24 = 0;
8429 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_KWs.diminfo[0].shape)) __pyx_t_24 = 0;
8430 if (__pyx_t_29 < 0) {
8431 __pyx_t_29 += __pyx_pybuffernd_KWs.diminfo[1].shape;
8432 if (unlikely(__pyx_t_29 < 0)) __pyx_t_24 = 1;
8433 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_KWs.diminfo[1].shape)) __pyx_t_24 = 1;
8434 if (unlikely(__pyx_t_24 != -1)) {
8435 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8436 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8438 __pyx_t_30 = __pyx_v_ii;
8440 if (__pyx_t_30 < 0) {
8441 __pyx_t_30 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
8442 if (unlikely(__pyx_t_30 < 0)) __pyx_t_24 = 0;
8443 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_24 = 0;
8444 if (unlikely(__pyx_t_24 != -1)) {
8445 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8446 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8448 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_a_neig.diminfo[0].strides) = (__pyx_v_rho * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_KWs.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_KWs.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_KWs.diminfo[1].strides)));
8467 __pyx_t_18 = __pyx_v_nnz;
8468 for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_18; __pyx_t_22+=1) {
8469 __pyx_v_ii = __pyx_t_22;
8478 __pyx_t_31 = __pyx_v_ii;
8480 if (__pyx_t_31 < 0) {
8481 __pyx_t_31 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8482 if (unlikely(__pyx_t_31 < 0)) __pyx_t_24 = 0;
8483 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_24 = 0;
8484 if (unlikely(__pyx_t_24 != -1)) {
8485 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8486 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8488 __pyx_t_32 = __pyx_v_ii;
8490 if (__pyx_t_32 < 0) {
8491 __pyx_t_32 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
8492 if (unlikely(__pyx_t_32 < 0)) __pyx_t_24 = 0;
8493 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_24 = 0;
8494 if (unlikely(__pyx_t_24 != -1)) {
8495 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8496 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8498 __pyx_t_33 = ((2.0 * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_a_eN.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_a_neig.diminfo[0].strides)));
8499 __pyx_t_34 = __pyx_v_ii;
8501 if (__pyx_t_34 < 0) {
8502 __pyx_t_34 += __pyx_pybuffernd_a_eN.diminfo[0].shape;
8503 if (unlikely(__pyx_t_34 < 0)) __pyx_t_24 = 0;
8504 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_a_eN.diminfo[0].shape)) __pyx_t_24 = 0;
8505 if (unlikely(__pyx_t_24 != -1)) {
8506 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8507 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8509 __pyx_t_35 = __pyx_v_ii;
8511 if (__pyx_t_35 < 0) {
8512 __pyx_t_35 += __pyx_pybuffernd_a_neig.diminfo[0].shape;
8513 if (unlikely(__pyx_t_35 < 0)) __pyx_t_24 = 0;
8514 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_a_neig.diminfo[0].shape)) __pyx_t_24 = 0;
8515 if (unlikely(__pyx_t_24 != -1)) {
8516 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8517 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8519 __pyx_t_36 = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_eN.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_a_eN.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_neig.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_a_neig.diminfo[0].strides))) + 1.0e-20);
8520 if (unlikely(__pyx_t_36 == 0)) {
8521 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
8522 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8524 __pyx_t_37 = __pyx_v_ii;
8526 if (__pyx_t_37 < 0) {
8527 __pyx_t_37 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
8528 if (unlikely(__pyx_t_37 < 0)) __pyx_t_24 = 0;
8529 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_24 = 0;
8530 if (unlikely(__pyx_t_24 != -1)) {
8531 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8532 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 349; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8534 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_a_avg.diminfo[0].strides) = (__pyx_t_33 / __pyx_t_36);
8543 __pyx_t_38 = __pyx_v_ii;
8545 if (__pyx_t_38 < 0) {
8546 __pyx_t_38 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
8547 if (unlikely(__pyx_t_38 < 0)) __pyx_t_24 = 0;
8548 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_24 = 0;
8549 if (unlikely(__pyx_t_24 != -1)) {
8550 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8551 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8553 __pyx_t_39 = __pyx_v_eN;
8554 __pyx_t_40 = __pyx_v_ebN;
8555 __pyx_t_41 = __pyx_v_ii;
8557 if (__pyx_t_39 < 0) {
8558 __pyx_t_39 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
8559 if (unlikely(__pyx_t_39 < 0)) __pyx_t_24 = 0;
8560 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_24 = 0;
8561 if (__pyx_t_40 < 0) {
8562 __pyx_t_40 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
8563 if (unlikely(__pyx_t_40 < 0)) __pyx_t_24 = 1;
8564 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_24 = 1;
8565 if (__pyx_t_41 < 0) {
8566 __pyx_t_41 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
8567 if (unlikely(__pyx_t_41 < 0)) __pyx_t_24 = 2;
8568 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_24 = 2;
8569 if (unlikely(__pyx_t_24 != -1)) {
8570 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8571 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 350; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8573 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_q_alin.diminfo[2].strides) = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_a_avg.diminfo[0].strides));
8583 __pyx_t_18 = __pyx_v_nSpace;
8584 for (__pyx_t_22 = 0; __pyx_t_22 < __pyx_t_18; __pyx_t_22+=1) {
8585 __pyx_v_I = __pyx_t_22;
8594 __pyx_t_42 = __pyx_v_eN;
8595 __pyx_t_43 = __pyx_v_ebN;
8596 __pyx_t_44 = __pyx_v_I;
8598 if (__pyx_t_42 < 0) {
8599 __pyx_t_42 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
8600 if (unlikely(__pyx_t_42 < 0)) __pyx_t_24 = 0;
8601 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_24 = 0;
8602 if (__pyx_t_43 < 0) {
8603 __pyx_t_43 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
8604 if (unlikely(__pyx_t_43 < 0)) __pyx_t_24 = 1;
8605 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_24 = 1;
8606 if (__pyx_t_44 < 0) {
8607 __pyx_t_44 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
8608 if (unlikely(__pyx_t_44 < 0)) __pyx_t_24 = 2;
8609 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_24 = 2;
8610 if (unlikely(__pyx_t_24 != -1)) {
8611 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8612 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8614 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_44, __pyx_pybuffernd_q_flin.diminfo[2].strides) = 0.0;
8623 __pyx_t_45 = (__pyx_v_I + 1);
8625 if (__pyx_t_45 < 0) {
8626 __pyx_t_45 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
8627 if (unlikely(__pyx_t_45 < 0)) __pyx_t_24 = 0;
8628 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_24 = 0;
8629 if (unlikely(__pyx_t_24 != -1)) {
8630 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8631 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8633 __pyx_t_46 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_rowptr.diminfo[0].strides));
8634 __pyx_t_47 = __pyx_v_I;
8636 if (__pyx_t_47 < 0) {
8637 __pyx_t_47 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
8638 if (unlikely(__pyx_t_47 < 0)) __pyx_t_24 = 0;
8639 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_24 = 0;
8640 if (unlikely(__pyx_t_24 != -1)) {
8641 __Pyx_RaiseBufferIndexError(__pyx_t_24);
8642 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 353; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8644 for (__pyx_t_24 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_24 < __pyx_t_46; __pyx_t_24+=1) {
8645 __pyx_v_ii = __pyx_t_24;
8654 __pyx_t_48 = __pyx_v_ii;
8656 if (__pyx_t_48 < 0) {
8657 __pyx_t_48 += __pyx_pybuffernd_a_avg.diminfo[0].shape;
8658 if (unlikely(__pyx_t_48 < 0)) __pyx_t_49 = 0;
8659 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_a_avg.diminfo[0].shape)) __pyx_t_49 = 0;
8660 if (unlikely(__pyx_t_49 != -1)) {
8661 __Pyx_RaiseBufferIndexError(__pyx_t_49);
8662 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8664 __pyx_t_50 = __pyx_v_ii;
8666 if (__pyx_t_50 < 0) {
8667 __pyx_t_50 += __pyx_pybuffernd_colind.diminfo[0].shape;
8668 if (unlikely(__pyx_t_50 < 0)) __pyx_t_49 = 0;
8669 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_49 = 0;
8670 if (unlikely(__pyx_t_49 != -1)) {
8671 __Pyx_RaiseBufferIndexError(__pyx_t_49);
8672 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8674 __pyx_t_51 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_colind.diminfo[0].strides));
8676 if (__pyx_t_51 < 0) {
8677 __pyx_t_51 += __pyx_pybuffernd_gravity.diminfo[0].shape;
8678 if (unlikely(__pyx_t_51 < 0)) __pyx_t_49 = 0;
8679 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_gravity.diminfo[0].shape)) __pyx_t_49 = 0;
8680 if (unlikely(__pyx_t_49 != -1)) {
8681 __Pyx_RaiseBufferIndexError(__pyx_t_49);
8682 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8684 __pyx_t_52 = __pyx_v_eN;
8685 __pyx_t_53 = __pyx_v_ebN;
8686 __pyx_t_54 = __pyx_v_I;
8688 if (__pyx_t_52 < 0) {
8689 __pyx_t_52 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
8690 if (unlikely(__pyx_t_52 < 0)) __pyx_t_49 = 0;
8691 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_49 = 0;
8692 if (__pyx_t_53 < 0) {
8693 __pyx_t_53 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
8694 if (unlikely(__pyx_t_53 < 0)) __pyx_t_49 = 1;
8695 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_49 = 1;
8696 if (__pyx_t_54 < 0) {
8697 __pyx_t_54 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
8698 if (unlikely(__pyx_t_54 < 0)) __pyx_t_49 = 2;
8699 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_49 = 2;
8700 if (unlikely(__pyx_t_49 != -1)) {
8701 __Pyx_RaiseBufferIndexError(__pyx_t_49);
8702 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
8704 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_q_flin.diminfo[2].strides) += ((__pyx_v_rho * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_avg.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_a_avg.diminfo[0].strides))) * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_gravity.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_gravity.diminfo[0].strides)));
8719 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
8722 __Pyx_XDECREF(__pyx_t_3);
8723 __Pyx_XDECREF(__pyx_t_4);
8724 __Pyx_XDECREF(__pyx_t_5);
8725 __Pyx_XDECREF(__pyx_t_6);
8726 __Pyx_XDECREF(__pyx_t_8);
8727 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
8728 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
8729 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
8730 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
8731 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
8732 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
8733 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
8734 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
8735 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
8736 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
8737 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
8738 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
8739 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
8740 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
8741 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_Linear", __pyx_clineno, __pyx_lineno, __pyx_filename);
8745 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_KWs.rcbuffer->pybuffer);
8746 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_avg.rcbuffer->pybuffer);
8747 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_eN.rcbuffer->pybuffer);
8748 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_neig.rcbuffer->pybuffer);
8749 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
8750 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
8751 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
8752 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
8753 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
8754 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
8755 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
8757 __Pyx_XDECREF((PyObject *)__pyx_v_a_eN);
8758 __Pyx_XDECREF((PyObject *)__pyx_v_a_neig);
8759 __Pyx_XDECREF((PyObject *)__pyx_v_a_avg);
8760 __Pyx_XGIVEREF(__pyx_r);
8761 __Pyx_RefNannyFinishContext();
8774 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
8775 static char __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM[] =
"\n routine for evaluating nodal coefficients in NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n assumes slight compressiblity for now\n\n TODO:\n everything\n \n ";
8776 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM = {
"RE_NCP1_evaluateElementCoefficients_VGM", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM};
8777 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
8779 double __pyx_v_beta;
8780 PyArrayObject *__pyx_v_gravity = 0;
8781 PyArrayObject *__pyx_v_alpha = 0;
8782 PyArrayObject *__pyx_v_n = 0;
8783 PyArrayObject *__pyx_v_thetaR = 0;
8784 PyArrayObject *__pyx_v_thetaSR = 0;
8786 int __pyx_v_nElements_global;
8787 int __pyx_v_nElementBoundaries_element;
8788 PyArrayObject *__pyx_v_elementNeighborsArray = 0;
8789 PyArrayObject *__pyx_v_elementBarycentersArray = 0;
8790 PyArrayObject *__pyx_v_elementMaterialTypes = 0;
8791 int __pyx_v_nDOF_trial_element;
8792 PyArrayObject *__pyx_v_u_l2g = 0;
8793 PyArrayObject *__pyx_v_u_dof = 0;
8794 CYTHON_UNUSED PyArrayObject *__pyx_v_q_x = 0;
8795 PyArrayObject *__pyx_v_q_u = 0;
8796 PyArrayObject *__pyx_v_q_mass = 0;
8797 PyArrayObject *__pyx_v_q_dmass = 0;
8798 PyArrayObject *__pyx_v_q_r = 0;
8799 PyArrayObject *__pyx_v_q_kr = 0;
8800 PyArrayObject *__pyx_v_q_dkr = 0;
8801 PyArrayObject *__pyx_v_q_kr_up = 0;
8802 int __pyx_lineno = 0;
8803 const char *__pyx_filename = NULL;
8804 int __pyx_clineno = 0;
8805 PyObject *__pyx_r = 0;
8806 __Pyx_RefNannyDeclarations
8807 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM (wrapper)", 0);
8809 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_rho,&__pyx_n_s_beta,&__pyx_n_s_gravity,&__pyx_n_s_alpha,&__pyx_n_s_n,&__pyx_n_s_thetaR,&__pyx_n_s_thetaSR,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_elementMaterialTypes,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_u_l2g,&__pyx_n_s_u_dof,&__pyx_n_s_q_x,&__pyx_n_s_q_u,&__pyx_n_s_q_mass,&__pyx_n_s_q_dmass,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,0};
8810 PyObject* values[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
8811 if (unlikely(__pyx_kwds)) {
8813 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8815 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8816 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8817 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8818 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8819 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8820 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8821 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8822 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8823 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8824 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8825 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8826 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8827 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8828 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8829 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8830 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8831 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8832 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8833 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8834 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8835 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8836 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8837 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8838 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8840 default:
goto __pyx_L5_argtuple_error;
8842 kw_args = PyDict_Size(__pyx_kwds);
8845 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rho)) != 0)) kw_args--;
8846 else goto __pyx_L5_argtuple_error;
8848 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_beta)) != 0)) kw_args--;
8850 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8853 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
8855 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8858 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_alpha)) != 0)) kw_args--;
8860 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8863 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
8865 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8868 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thetaR)) != 0)) kw_args--;
8870 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8873 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_thetaSR)) != 0)) kw_args--;
8875 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8878 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
8880 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8883 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
8885 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8888 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
8890 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8893 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
8895 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8898 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
8900 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8903 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementMaterialTypes)) != 0)) kw_args--;
8905 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8908 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
8910 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8913 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u_l2g)) != 0)) kw_args--;
8915 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8918 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_u_dof)) != 0)) kw_args--;
8920 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8923 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_x)) != 0)) kw_args--;
8925 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8928 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
8930 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8933 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mass)) != 0)) kw_args--;
8935 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8938 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dmass)) != 0)) kw_args--;
8940 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8943 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
8945 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8948 if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
8950 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8953 if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
8955 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8958 if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
8960 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8963 if (unlikely(kw_args > 0)) {
8964 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_evaluateElementCoefficients_VGM") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8966 }
else if (PyTuple_GET_SIZE(__pyx_args) != 24) {
8967 goto __pyx_L5_argtuple_error;
8969 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8970 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8971 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8972 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8973 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8974 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8975 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
8976 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
8977 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
8978 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
8979 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
8980 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
8981 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
8982 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
8983 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
8984 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
8985 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
8986 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
8987 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
8988 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
8989 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
8990 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
8991 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
8992 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
8994 __pyx_v_rho = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_rho == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8995 __pyx_v_beta = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_beta == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
8996 __pyx_v_gravity = ((PyArrayObject *)values[2]);
8997 __pyx_v_alpha = ((PyArrayObject *)values[3]);
8998 __pyx_v_n = ((PyArrayObject *)values[4]);
8999 __pyx_v_thetaR = ((PyArrayObject *)values[5]);
9000 __pyx_v_thetaSR = ((PyArrayObject *)values[6]);
9001 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[7]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
9002 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 368; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
9003 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
9004 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[10]);
9005 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[11]);
9006 __pyx_v_elementMaterialTypes = ((PyArrayObject *)values[12]);
9007 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[13]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 374; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
9008 __pyx_v_u_l2g = ((PyArrayObject *)values[14]);
9009 __pyx_v_u_dof = ((PyArrayObject *)values[15]);
9010 __pyx_v_q_x = ((PyArrayObject *)values[16]);
9011 __pyx_v_q_u = ((PyArrayObject *)values[17]);
9012 __pyx_v_q_mass = ((PyArrayObject *)values[18]);
9013 __pyx_v_q_dmass = ((PyArrayObject *)values[19]);
9014 __pyx_v_q_r = ((PyArrayObject *)values[20]);
9015 __pyx_v_q_kr = ((PyArrayObject *)values[21]);
9016 __pyx_v_q_dkr = ((PyArrayObject *)values[22]);
9017 __pyx_v_q_kr_up = ((PyArrayObject *)values[23]);
9019 goto __pyx_L4_argument_unpacking_done;
9020 __pyx_L5_argtuple_error:;
9021 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_evaluateElementCoefficients_VGM", 1, 24, 24, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
9023 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
9024 __Pyx_RefNannyFinishContext();
9026 __pyx_L4_argument_unpacking_done:;
9027 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 361; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9028 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_alpha), __pyx_ptype_5numpy_ndarray, 1,
"alpha", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 362; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9029 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 363; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9030 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaR), __pyx_ptype_5numpy_ndarray, 1,
"thetaR", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 364; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9031 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_thetaSR), __pyx_ptype_5numpy_ndarray, 1,
"thetaSR", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 365; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9032 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9033 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 371; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9034 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementMaterialTypes), __pyx_ptype_5numpy_ndarray, 1,
"elementMaterialTypes", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 372; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9035 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_l2g), __pyx_ptype_5numpy_ndarray, 1,
"u_l2g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 375; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9036 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_u_dof), __pyx_ptype_5numpy_ndarray, 1,
"u_dof", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 376; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9037 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_x), __pyx_ptype_5numpy_ndarray, 1,
"q_x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 378; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9038 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 379; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9039 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mass), __pyx_ptype_5numpy_ndarray, 1,
"q_mass", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 380; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9040 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmass), __pyx_ptype_5numpy_ndarray, 1,
"q_dmass", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 381; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9041 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 382; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9042 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 383; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9043 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 384; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9044 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 385; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9045 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(__pyx_self, __pyx_v_rho, __pyx_v_beta, __pyx_v_gravity, __pyx_v_alpha, __pyx_v_n, __pyx_v_thetaR, __pyx_v_thetaSR, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_elementMaterialTypes, __pyx_v_nDOF_trial_element, __pyx_v_u_l2g, __pyx_v_u_dof, __pyx_v_q_x, __pyx_v_q_u, __pyx_v_q_mass, __pyx_v_q_dmass, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up);
9052 __Pyx_RefNannyFinishContext();
9056 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_30RE_NCP1_evaluateElementCoefficients_VGM(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_rho,
double __pyx_v_beta, PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_alpha, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_thetaR, PyArrayObject *__pyx_v_thetaSR,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, PyArrayObject *__pyx_v_elementNeighborsArray, PyArrayObject *__pyx_v_elementBarycentersArray, PyArrayObject *__pyx_v_elementMaterialTypes,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_u_l2g, PyArrayObject *__pyx_v_u_dof, CYTHON_UNUSED PyArrayObject *__pyx_v_q_x, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_mass, PyArrayObject *__pyx_v_q_dmass, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up) {
9057 PyObject *__pyx_v_q = NULL;
9058 double __pyx_v_psiC;
9059 double __pyx_v_pcBar;
9060 double __pyx_v_pcBar_n;
9061 double __pyx_v_pcBar_nM1;
9062 double __pyx_v_pcBar_nM2;
9063 double __pyx_v_onePlus_pcBar_n;
9064 double __pyx_v_sBar;
9065 double __pyx_v_sqrt_sBar;
9066 double __pyx_v_DsBar_DpsiC;
9067 double __pyx_v_thetaW;
9068 double __pyx_v_DthetaW_DpsiC;
9069 double __pyx_v_vBar;
9070 double __pyx_v_vBar2;
9071 double __pyx_v_DvBar_DpsiC;
9073 double __pyx_v_DKWr_DpsiC;
9074 CYTHON_UNUSED
double __pyx_v_rho2;
9075 double __pyx_v_thetaS;
9076 double __pyx_v_rhom;
9077 double __pyx_v_drhom;
9080 double __pyx_v_u_eN;
9081 double __pyx_v_u_neig;
9082 double __pyx_v_kr_eN;
9083 double __pyx_v_kr_neig;
9084 double __pyx_v_phi_eN;
9085 double __pyx_v_phi_neig;
9087 int __pyx_v_eN_neighbor;
9091 double __pyx_v_nAvgWeight;
9092 __Pyx_LocalBuf_ND __pyx_pybuffernd_alpha;
9093 __Pyx_Buffer __pyx_pybuffer_alpha;
9094 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
9095 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
9096 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementMaterialTypes;
9097 __Pyx_Buffer __pyx_pybuffer_elementMaterialTypes;
9098 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
9099 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
9100 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
9101 __Pyx_Buffer __pyx_pybuffer_gravity;
9102 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
9103 __Pyx_Buffer __pyx_pybuffer_n;
9104 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
9105 __Pyx_Buffer __pyx_pybuffer_q_dkr;
9106 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmass;
9107 __Pyx_Buffer __pyx_pybuffer_q_dmass;
9108 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
9109 __Pyx_Buffer __pyx_pybuffer_q_kr;
9110 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
9111 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
9112 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mass;
9113 __Pyx_Buffer __pyx_pybuffer_q_mass;
9114 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
9115 __Pyx_Buffer __pyx_pybuffer_q_r;
9116 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
9117 __Pyx_Buffer __pyx_pybuffer_q_u;
9118 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_x;
9119 __Pyx_Buffer __pyx_pybuffer_q_x;
9120 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaR;
9121 __Pyx_Buffer __pyx_pybuffer_thetaR;
9122 __Pyx_LocalBuf_ND __pyx_pybuffernd_thetaSR;
9123 __Pyx_Buffer __pyx_pybuffer_thetaSR;
9124 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_dof;
9125 __Pyx_Buffer __pyx_pybuffer_u_dof;
9126 __Pyx_LocalBuf_ND __pyx_pybuffernd_u_l2g;
9127 __Pyx_Buffer __pyx_pybuffer_u_l2g;
9128 PyObject *__pyx_r = NULL;
9129 __Pyx_RefNannyDeclarations
9130 PyObject *__pyx_t_1 = NULL;
9131 PyObject *__pyx_t_2 = NULL;
9132 Py_ssize_t __pyx_t_3;
9133 PyObject *__pyx_t_4 = NULL;
9134 PyObject *__pyx_t_5 = NULL;
9139 Py_ssize_t __pyx_t_10;
9142 Py_ssize_t __pyx_t_13;
9143 Py_ssize_t __pyx_t_14;
9145 Py_ssize_t __pyx_t_16;
9146 Py_ssize_t __pyx_t_17;
9147 Py_ssize_t __pyx_t_18;
9148 Py_ssize_t __pyx_t_19;
9149 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_20;
9150 Py_ssize_t __pyx_t_21;
9151 Py_ssize_t __pyx_t_22;
9152 Py_ssize_t __pyx_t_23;
9153 Py_ssize_t __pyx_t_24;
9154 Py_ssize_t __pyx_t_25;
9155 Py_ssize_t __pyx_t_26;
9156 Py_ssize_t __pyx_t_27;
9157 Py_ssize_t __pyx_t_28;
9158 Py_ssize_t __pyx_t_29;
9159 Py_ssize_t __pyx_t_30;
9160 Py_ssize_t __pyx_t_31;
9161 Py_ssize_t __pyx_t_32;
9162 Py_ssize_t __pyx_t_33;
9163 Py_ssize_t __pyx_t_34;
9164 Py_ssize_t __pyx_t_35;
9165 Py_ssize_t __pyx_t_36;
9166 Py_ssize_t __pyx_t_37;
9167 Py_ssize_t __pyx_t_38;
9168 Py_ssize_t __pyx_t_39;
9169 PyObject *__pyx_t_40 = NULL;
9170 PyObject *__pyx_t_41 = NULL;
9171 Py_ssize_t __pyx_t_42;
9172 Py_ssize_t __pyx_t_43;
9173 Py_ssize_t __pyx_t_44;
9174 Py_ssize_t __pyx_t_45;
9175 Py_ssize_t __pyx_t_46;
9176 Py_ssize_t __pyx_t_47;
9177 int __pyx_lineno = 0;
9178 const char *__pyx_filename = NULL;
9179 int __pyx_clineno = 0;
9180 __Pyx_RefNannySetupContext(
"RE_NCP1_evaluateElementCoefficients_VGM", 0);
9181 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
9182 __pyx_pybuffer_gravity.refcount = 0;
9183 __pyx_pybuffernd_gravity.data = NULL;
9184 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
9185 __pyx_pybuffer_alpha.pybuffer.buf = NULL;
9186 __pyx_pybuffer_alpha.refcount = 0;
9187 __pyx_pybuffernd_alpha.data = NULL;
9188 __pyx_pybuffernd_alpha.rcbuffer = &__pyx_pybuffer_alpha;
9189 __pyx_pybuffer_n.pybuffer.buf = NULL;
9190 __pyx_pybuffer_n.refcount = 0;
9191 __pyx_pybuffernd_n.data = NULL;
9192 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
9193 __pyx_pybuffer_thetaR.pybuffer.buf = NULL;
9194 __pyx_pybuffer_thetaR.refcount = 0;
9195 __pyx_pybuffernd_thetaR.data = NULL;
9196 __pyx_pybuffernd_thetaR.rcbuffer = &__pyx_pybuffer_thetaR;
9197 __pyx_pybuffer_thetaSR.pybuffer.buf = NULL;
9198 __pyx_pybuffer_thetaSR.refcount = 0;
9199 __pyx_pybuffernd_thetaSR.data = NULL;
9200 __pyx_pybuffernd_thetaSR.rcbuffer = &__pyx_pybuffer_thetaSR;
9201 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
9202 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
9203 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
9204 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
9205 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
9206 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
9207 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
9208 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
9209 __pyx_pybuffer_elementMaterialTypes.pybuffer.buf = NULL;
9210 __pyx_pybuffer_elementMaterialTypes.refcount = 0;
9211 __pyx_pybuffernd_elementMaterialTypes.data = NULL;
9212 __pyx_pybuffernd_elementMaterialTypes.rcbuffer = &__pyx_pybuffer_elementMaterialTypes;
9213 __pyx_pybuffer_u_l2g.pybuffer.buf = NULL;
9214 __pyx_pybuffer_u_l2g.refcount = 0;
9215 __pyx_pybuffernd_u_l2g.data = NULL;
9216 __pyx_pybuffernd_u_l2g.rcbuffer = &__pyx_pybuffer_u_l2g;
9217 __pyx_pybuffer_u_dof.pybuffer.buf = NULL;
9218 __pyx_pybuffer_u_dof.refcount = 0;
9219 __pyx_pybuffernd_u_dof.data = NULL;
9220 __pyx_pybuffernd_u_dof.rcbuffer = &__pyx_pybuffer_u_dof;
9221 __pyx_pybuffer_q_x.pybuffer.buf = NULL;
9222 __pyx_pybuffer_q_x.refcount = 0;
9223 __pyx_pybuffernd_q_x.data = NULL;
9224 __pyx_pybuffernd_q_x.rcbuffer = &__pyx_pybuffer_q_x;
9225 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
9226 __pyx_pybuffer_q_u.refcount = 0;
9227 __pyx_pybuffernd_q_u.data = NULL;
9228 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
9229 __pyx_pybuffer_q_mass.pybuffer.buf = NULL;
9230 __pyx_pybuffer_q_mass.refcount = 0;
9231 __pyx_pybuffernd_q_mass.data = NULL;
9232 __pyx_pybuffernd_q_mass.rcbuffer = &__pyx_pybuffer_q_mass;
9233 __pyx_pybuffer_q_dmass.pybuffer.buf = NULL;
9234 __pyx_pybuffer_q_dmass.refcount = 0;
9235 __pyx_pybuffernd_q_dmass.data = NULL;
9236 __pyx_pybuffernd_q_dmass.rcbuffer = &__pyx_pybuffer_q_dmass;
9237 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
9238 __pyx_pybuffer_q_r.refcount = 0;
9239 __pyx_pybuffernd_q_r.data = NULL;
9240 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
9241 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
9242 __pyx_pybuffer_q_kr.refcount = 0;
9243 __pyx_pybuffernd_q_kr.data = NULL;
9244 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
9245 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
9246 __pyx_pybuffer_q_dkr.refcount = 0;
9247 __pyx_pybuffernd_q_dkr.data = NULL;
9248 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
9249 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
9250 __pyx_pybuffer_q_kr_up.refcount = 0;
9251 __pyx_pybuffernd_q_kr_up.data = NULL;
9252 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
9254 __Pyx_BufFmt_StackElem __pyx_stack[1];
9255 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9257 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
9259 __Pyx_BufFmt_StackElem __pyx_stack[1];
9260 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer, (PyObject*)__pyx_v_alpha, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9262 __pyx_pybuffernd_alpha.diminfo[0].strides = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_alpha.diminfo[0].shape = __pyx_pybuffernd_alpha.rcbuffer->pybuffer.shape[0];
9264 __Pyx_BufFmt_StackElem __pyx_stack[1];
9265 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9267 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0];
9269 __Pyx_BufFmt_StackElem __pyx_stack[1];
9270 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9272 __pyx_pybuffernd_thetaR.diminfo[0].strides = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaR.diminfo[0].shape = __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.shape[0];
9274 __Pyx_BufFmt_StackElem __pyx_stack[1];
9275 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer, (PyObject*)__pyx_v_thetaSR, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9277 __pyx_pybuffernd_thetaSR.diminfo[0].strides = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_thetaSR.diminfo[0].shape = __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.shape[0];
9279 __Pyx_BufFmt_StackElem __pyx_stack[1];
9280 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9282 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
9284 __Pyx_BufFmt_StackElem __pyx_stack[1];
9285 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9287 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
9289 __Pyx_BufFmt_StackElem __pyx_stack[1];
9290 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementMaterialTypes, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9292 __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape = __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.shape[0];
9294 __Pyx_BufFmt_StackElem __pyx_stack[1];
9295 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9297 __pyx_pybuffernd_u_l2g.diminfo[0].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_l2g.diminfo[0].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_u_l2g.diminfo[1].strides = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_u_l2g.diminfo[1].shape = __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.shape[1];
9299 __Pyx_BufFmt_StackElem __pyx_stack[1];
9300 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer, (PyObject*)__pyx_v_u_dof, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9302 __pyx_pybuffernd_u_dof.diminfo[0].strides = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_u_dof.diminfo[0].shape = __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.shape[0];
9304 __Pyx_BufFmt_StackElem __pyx_stack[1];
9305 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9307 __pyx_pybuffernd_q_x.diminfo[0].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_x.diminfo[0].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_x.diminfo[1].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_x.diminfo[1].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_x.diminfo[2].strides = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_x.diminfo[2].shape = __pyx_pybuffernd_q_x.rcbuffer->pybuffer.shape[2];
9309 __Pyx_BufFmt_StackElem __pyx_stack[1];
9310 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9312 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
9314 __Pyx_BufFmt_StackElem __pyx_stack[1];
9315 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9317 __pyx_pybuffernd_q_mass.diminfo[0].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mass.diminfo[0].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mass.diminfo[1].strides = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mass.diminfo[1].shape = __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.shape[1];
9319 __Pyx_BufFmt_StackElem __pyx_stack[1];
9320 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmass, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9322 __pyx_pybuffernd_q_dmass.diminfo[0].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmass.diminfo[0].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmass.diminfo[1].strides = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmass.diminfo[1].shape = __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.shape[1];
9324 __Pyx_BufFmt_StackElem __pyx_stack[1];
9325 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9327 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
9329 __Pyx_BufFmt_StackElem __pyx_stack[1];
9330 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9332 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
9334 __Pyx_BufFmt_StackElem __pyx_stack[1];
9335 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9337 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
9339 __Pyx_BufFmt_StackElem __pyx_stack[1];
9340 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9342 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
9351 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9352 __Pyx_GOTREF(__pyx_t_1);
9353 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
9354 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
9355 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
9356 __Pyx_INCREF(((PyObject *)__pyx_v_q_mass));
9357 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mass));
9358 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_mass));
9359 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
9360 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
9361 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_r));
9362 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
9363 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
9364 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_kr));
9365 __Pyx_INCREF(((PyObject *)__pyx_v_q_dkr));
9366 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_dkr));
9367 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_dkr));
9368 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
9369 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9371 if (__pyx_t_3 >= 5)
break;
9372 #if CYTHON_COMPILING_IN_CPYTHON
9373 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9375 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9376 __Pyx_GOTREF(__pyx_t_1);
9378 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
9388 #ifndef CYTHON_WITHOUT_ASSERTIONS
9389 if (unlikely(!Py_OptimizeFlag)) {
9390 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9391 __Pyx_GOTREF(__pyx_t_1);
9392 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
9393 __Pyx_GOTREF(__pyx_t_4);
9394 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9395 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9396 __Pyx_GOTREF(__pyx_t_1);
9397 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9398 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9399 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9400 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9401 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9402 if (unlikely(!__pyx_t_6)) {
9403 PyErr_SetNone(PyExc_AssertionError);
9404 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 400; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9417 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9426 #ifndef CYTHON_WITHOUT_ASSERTIONS
9427 if (unlikely(!Py_OptimizeFlag)) {
9428 if (unlikely(!((__pyx_v_nDOF_trial_element == (__pyx_v_nSpace + 1)) != 0))) {
9429 PyErr_SetNone(PyExc_AssertionError);
9430 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 401; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9442 __pyx_v_rho2 = (__pyx_v_rho * __pyx_v_rho);
9451 __pyx_t_7 = (__pyx_v_nSpace + 1.);
9452 if (unlikely(__pyx_t_7 == 0)) {
9453 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9454 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9456 __pyx_v_nAvgWeight = (1.0 / __pyx_t_7);
9465 __pyx_t_8 = __pyx_v_nElements_global;
9466 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
9467 __pyx_v_eN = __pyx_t_9;
9476 __pyx_t_10 = __pyx_v_eN;
9478 if (__pyx_t_10 < 0) {
9479 __pyx_t_10 += __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape;
9480 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 0;
9481 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_elementMaterialTypes.diminfo[0].shape)) __pyx_t_11 = 0;
9482 if (unlikely(__pyx_t_11 != -1)) {
9483 __Pyx_RaiseBufferIndexError(__pyx_t_11);
9484 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 413; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9486 __pyx_v_matID = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_elementMaterialTypes.diminfo[0].strides));
9495 __pyx_t_11 = __pyx_v_nDOF_trial_element;
9496 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
9497 __pyx_v_j = __pyx_t_12;
9506 __pyx_t_13 = __pyx_v_eN;
9507 __pyx_t_14 = __pyx_v_j;
9509 if (__pyx_t_13 < 0) {
9510 __pyx_t_13 += __pyx_pybuffernd_u_l2g.diminfo[0].shape;
9511 if (unlikely(__pyx_t_13 < 0)) __pyx_t_15 = 0;
9512 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_u_l2g.diminfo[0].shape)) __pyx_t_15 = 0;
9513 if (__pyx_t_14 < 0) {
9514 __pyx_t_14 += __pyx_pybuffernd_u_l2g.diminfo[1].shape;
9515 if (unlikely(__pyx_t_14 < 0)) __pyx_t_15 = 1;
9516 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_u_l2g.diminfo[1].shape)) __pyx_t_15 = 1;
9517 if (unlikely(__pyx_t_15 != -1)) {
9518 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9519 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9521 __pyx_t_16 = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_u_l2g.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_u_l2g.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_u_l2g.diminfo[1].strides));
9523 if (__pyx_t_16 < 0) {
9524 __pyx_t_16 += __pyx_pybuffernd_u_dof.diminfo[0].shape;
9525 if (unlikely(__pyx_t_16 < 0)) __pyx_t_15 = 0;
9526 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_u_dof.diminfo[0].shape)) __pyx_t_15 = 0;
9527 if (unlikely(__pyx_t_15 != -1)) {
9528 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9529 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 415; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9531 __pyx_v_u_j = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_u_dof.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_u_dof.diminfo[0].strides));
9540 __pyx_t_17 = __pyx_v_eN;
9541 __pyx_t_18 = __pyx_v_j;
9543 if (__pyx_t_17 < 0) {
9544 __pyx_t_17 += __pyx_pybuffernd_q_u.diminfo[0].shape;
9545 if (unlikely(__pyx_t_17 < 0)) __pyx_t_15 = 0;
9546 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_q_u.diminfo[0].shape)) __pyx_t_15 = 0;
9547 if (__pyx_t_18 < 0) {
9548 __pyx_t_18 += __pyx_pybuffernd_q_u.diminfo[1].shape;
9549 if (unlikely(__pyx_t_18 < 0)) __pyx_t_15 = 1;
9550 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_u.diminfo[1].shape)) __pyx_t_15 = 1;
9551 if (unlikely(__pyx_t_15 != -1)) {
9552 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9553 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 416; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9555 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_u.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_q_u.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_q_u.diminfo[1].strides) = __pyx_v_u_j;
9564 __pyx_v_psiC = (-__pyx_v_u_j);
9573 __pyx_t_19 = __pyx_v_matID;
9575 if (__pyx_t_19 < 0) {
9576 __pyx_t_19 += __pyx_pybuffernd_n.diminfo[0].shape;
9577 if (unlikely(__pyx_t_19 < 0)) __pyx_t_15 = 0;
9578 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
9579 if (unlikely(__pyx_t_15 != -1)) {
9580 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9581 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9583 __pyx_t_20 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_n.diminfo[0].strides));
9584 if (unlikely(__pyx_t_20 == 0)) {
9585 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9586 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 420; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9588 __pyx_v_m = (1.0 - (1.0 / __pyx_t_20));
9597 __pyx_t_21 = __pyx_v_matID;
9599 if (__pyx_t_21 < 0) {
9600 __pyx_t_21 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
9601 if (unlikely(__pyx_t_21 < 0)) __pyx_t_15 = 0;
9602 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
9603 if (unlikely(__pyx_t_15 != -1)) {
9604 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9605 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9607 __pyx_t_22 = __pyx_v_matID;
9609 if (__pyx_t_22 < 0) {
9610 __pyx_t_22 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
9611 if (unlikely(__pyx_t_22 < 0)) __pyx_t_15 = 0;
9612 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
9613 if (unlikely(__pyx_t_15 != -1)) {
9614 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9615 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 421; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9617 __pyx_v_thetaS = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_thetaR.diminfo[0].strides)) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_thetaSR.diminfo[0].strides)));
9626 __pyx_t_6 = ((__pyx_v_psiC > 0.0) != 0);
9636 __pyx_t_23 = __pyx_v_matID;
9638 if (__pyx_t_23 < 0) {
9639 __pyx_t_23 += __pyx_pybuffernd_alpha.diminfo[0].shape;
9640 if (unlikely(__pyx_t_23 < 0)) __pyx_t_15 = 0;
9641 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
9642 if (unlikely(__pyx_t_15 != -1)) {
9643 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9644 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 423; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9646 __pyx_v_pcBar = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_alpha.diminfo[0].strides)) * __pyx_v_psiC);
9655 __pyx_t_24 = __pyx_v_matID;
9657 if (__pyx_t_24 < 0) {
9658 __pyx_t_24 += __pyx_pybuffernd_n.diminfo[0].shape;
9659 if (unlikely(__pyx_t_24 < 0)) __pyx_t_15 = 0;
9660 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
9661 if (unlikely(__pyx_t_15 != -1)) {
9662 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9663 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 424; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9665 __pyx_v_pcBar_nM2 = pow(__pyx_v_pcBar, ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_n.diminfo[0].strides)) - 2.0));
9674 __pyx_v_pcBar_nM1 = (__pyx_v_pcBar_nM2 * __pyx_v_pcBar);
9683 __pyx_v_pcBar_n = (__pyx_v_pcBar_nM1 * __pyx_v_pcBar);
9692 __pyx_v_onePlus_pcBar_n = (1.0 + __pyx_v_pcBar_n);
9701 __pyx_v_sBar = pow(__pyx_v_onePlus_pcBar_n, (-__pyx_v_m));
9710 __pyx_t_25 = __pyx_v_matID;
9712 if (__pyx_t_25 < 0) {
9713 __pyx_t_25 += __pyx_pybuffernd_alpha.diminfo[0].shape;
9714 if (unlikely(__pyx_t_25 < 0)) __pyx_t_15 = 0;
9715 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
9716 if (unlikely(__pyx_t_15 != -1)) {
9717 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9718 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9720 __pyx_t_26 = __pyx_v_matID;
9722 if (__pyx_t_26 < 0) {
9723 __pyx_t_26 += __pyx_pybuffernd_n.diminfo[0].shape;
9724 if (unlikely(__pyx_t_26 < 0)) __pyx_t_15 = 0;
9725 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
9726 if (unlikely(__pyx_t_15 != -1)) {
9727 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9728 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9730 if (unlikely(__pyx_v_onePlus_pcBar_n == 0)) {
9731 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9732 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 431; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9734 __pyx_v_DsBar_DpsiC = ((((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_alpha.diminfo[0].strides)) * (1.0 - (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_26, __pyx_pybuffernd_n.diminfo[0].strides)))) * (__pyx_v_sBar / __pyx_v_onePlus_pcBar_n)) * __pyx_v_pcBar_nM1);
9743 __pyx_v_vBar = (1.0 - (__pyx_v_pcBar_nM1 * __pyx_v_sBar));
9752 __pyx_v_vBar2 = (__pyx_v_vBar * __pyx_v_vBar);
9761 __pyx_t_27 = __pyx_v_matID;
9763 if (__pyx_t_27 < 0) {
9764 __pyx_t_27 += __pyx_pybuffernd_alpha.diminfo[0].shape;
9765 if (unlikely(__pyx_t_27 < 0)) __pyx_t_15 = 0;
9766 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_alpha.diminfo[0].shape)) __pyx_t_15 = 0;
9767 if (unlikely(__pyx_t_15 != -1)) {
9768 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9769 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9771 __pyx_t_28 = __pyx_v_matID;
9773 if (__pyx_t_28 < 0) {
9774 __pyx_t_28 += __pyx_pybuffernd_n.diminfo[0].shape;
9775 if (unlikely(__pyx_t_28 < 0)) __pyx_t_15 = 0;
9776 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_15 = 0;
9777 if (unlikely(__pyx_t_15 != -1)) {
9778 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9779 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 435; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9781 __pyx_v_DvBar_DpsiC = (((((-(*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_alpha.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_alpha.diminfo[0].strides))) * ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_n.diminfo[0].strides)) - 1.0)) * __pyx_v_pcBar_nM2) * __pyx_v_sBar) - (__pyx_v_pcBar_nM1 * __pyx_v_DsBar_DpsiC));
9790 __pyx_t_29 = __pyx_v_matID;
9792 if (__pyx_t_29 < 0) {
9793 __pyx_t_29 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
9794 if (unlikely(__pyx_t_29 < 0)) __pyx_t_15 = 0;
9795 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
9796 if (unlikely(__pyx_t_15 != -1)) {
9797 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9798 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9800 __pyx_t_30 = __pyx_v_matID;
9802 if (__pyx_t_30 < 0) {
9803 __pyx_t_30 += __pyx_pybuffernd_thetaR.diminfo[0].shape;
9804 if (unlikely(__pyx_t_30 < 0)) __pyx_t_15 = 0;
9805 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_thetaR.diminfo[0].shape)) __pyx_t_15 = 0;
9806 if (unlikely(__pyx_t_15 != -1)) {
9807 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9808 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9810 __pyx_v_thetaW = (((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_29, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_sBar) + (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaR.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_thetaR.diminfo[0].strides)));
9819 __pyx_t_31 = __pyx_v_matID;
9821 if (__pyx_t_31 < 0) {
9822 __pyx_t_31 += __pyx_pybuffernd_thetaSR.diminfo[0].shape;
9823 if (unlikely(__pyx_t_31 < 0)) __pyx_t_15 = 0;
9824 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_thetaSR.diminfo[0].shape)) __pyx_t_15 = 0;
9825 if (unlikely(__pyx_t_15 != -1)) {
9826 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9827 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 438; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9829 __pyx_v_DthetaW_DpsiC = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_thetaSR.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_thetaSR.diminfo[0].strides)) * __pyx_v_DsBar_DpsiC);
9838 __pyx_v_sqrt_sBar = sqrt(__pyx_v_sBar);
9847 __pyx_v_KWr = (__pyx_v_sqrt_sBar * __pyx_v_vBar2);
9856 if (unlikely(__pyx_v_sqrt_sBar == 0)) {
9857 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
9858 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9860 __pyx_v_DKWr_DpsiC = ((((0.5 / __pyx_v_sqrt_sBar) * __pyx_v_DsBar_DpsiC) * __pyx_v_vBar2) + (((2.0 * __pyx_v_sqrt_sBar) * __pyx_v_vBar) * __pyx_v_DvBar_DpsiC));
9880 __pyx_v_thetaW = __pyx_v_thetaS;
9889 __pyx_v_DthetaW_DpsiC = 0.0;
9907 __pyx_v_DKWr_DpsiC = 0.0;
9918 __pyx_v_rhom = (__pyx_v_rho * exp((__pyx_v_beta * __pyx_v_u_j)));
9927 __pyx_v_drhom = (__pyx_v_beta * __pyx_v_rhom);
9936 __pyx_t_32 = __pyx_v_eN;
9937 __pyx_t_33 = __pyx_v_j;
9939 if (__pyx_t_32 < 0) {
9940 __pyx_t_32 += __pyx_pybuffernd_q_mass.diminfo[0].shape;
9941 if (unlikely(__pyx_t_32 < 0)) __pyx_t_15 = 0;
9942 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_mass.diminfo[0].shape)) __pyx_t_15 = 0;
9943 if (__pyx_t_33 < 0) {
9944 __pyx_t_33 += __pyx_pybuffernd_q_mass.diminfo[1].shape;
9945 if (unlikely(__pyx_t_33 < 0)) __pyx_t_15 = 1;
9946 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_q_mass.diminfo[1].shape)) __pyx_t_15 = 1;
9947 if (unlikely(__pyx_t_15 != -1)) {
9948 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9949 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9951 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mass.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_q_mass.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_q_mass.diminfo[1].strides) = (__pyx_v_rhom * __pyx_v_thetaW);
9960 __pyx_t_34 = __pyx_v_eN;
9961 __pyx_t_35 = __pyx_v_j;
9963 if (__pyx_t_34 < 0) {
9964 __pyx_t_34 += __pyx_pybuffernd_q_dmass.diminfo[0].shape;
9965 if (unlikely(__pyx_t_34 < 0)) __pyx_t_15 = 0;
9966 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_dmass.diminfo[0].shape)) __pyx_t_15 = 0;
9967 if (__pyx_t_35 < 0) {
9968 __pyx_t_35 += __pyx_pybuffernd_q_dmass.diminfo[1].shape;
9969 if (unlikely(__pyx_t_35 < 0)) __pyx_t_15 = 1;
9970 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_dmass.diminfo[1].shape)) __pyx_t_15 = 1;
9971 if (unlikely(__pyx_t_15 != -1)) {
9972 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9973 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 452; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9975 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmass.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_dmass.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_dmass.diminfo[1].strides) = (((-__pyx_v_rhom) * __pyx_v_DthetaW_DpsiC) + (__pyx_v_drhom * __pyx_v_thetaW));
9984 __pyx_t_36 = __pyx_v_eN;
9985 __pyx_t_37 = __pyx_v_j;
9987 if (__pyx_t_36 < 0) {
9988 __pyx_t_36 += __pyx_pybuffernd_q_kr.diminfo[0].shape;
9989 if (unlikely(__pyx_t_36 < 0)) __pyx_t_15 = 0;
9990 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_kr.diminfo[0].shape)) __pyx_t_15 = 0;
9991 if (__pyx_t_37 < 0) {
9992 __pyx_t_37 += __pyx_pybuffernd_q_kr.diminfo[1].shape;
9993 if (unlikely(__pyx_t_37 < 0)) __pyx_t_15 = 1;
9994 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_kr.diminfo[1].shape)) __pyx_t_15 = 1;
9995 if (unlikely(__pyx_t_15 != -1)) {
9996 __Pyx_RaiseBufferIndexError(__pyx_t_15);
9997 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 454; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
9999 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_q_kr.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_q_kr.diminfo[1].strides) = __pyx_v_KWr;
10008 __pyx_t_38 = __pyx_v_eN;
10009 __pyx_t_39 = __pyx_v_j;
10011 if (__pyx_t_38 < 0) {
10012 __pyx_t_38 += __pyx_pybuffernd_q_dkr.diminfo[0].shape;
10013 if (unlikely(__pyx_t_38 < 0)) __pyx_t_15 = 0;
10014 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_dkr.diminfo[0].shape)) __pyx_t_15 = 0;
10015 if (__pyx_t_39 < 0) {
10016 __pyx_t_39 += __pyx_pybuffernd_q_dkr.diminfo[1].shape;
10017 if (unlikely(__pyx_t_39 < 0)) __pyx_t_15 = 1;
10018 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_dkr.diminfo[1].shape)) __pyx_t_15 = 1;
10019 if (unlikely(__pyx_t_15 != -1)) {
10020 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10021 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 455; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10023 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.buf, __pyx_t_38, __pyx_pybuffernd_q_dkr.diminfo[0].strides, __pyx_t_39, __pyx_pybuffernd_q_dkr.diminfo[1].strides) = (-__pyx_v_DKWr_DpsiC);
10034 __pyx_t_8 = __pyx_v_nElements_global;
10035 for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_8; __pyx_t_9+=1) {
10036 __pyx_v_eN = __pyx_t_9;
10045 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10046 __Pyx_GOTREF(__pyx_t_5);
10047 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10048 __Pyx_GOTREF(__pyx_t_1);
10049 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10050 __pyx_t_5 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10051 __Pyx_GOTREF(__pyx_t_5);
10053 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
10054 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
10055 if (likely(__pyx_t_4)) {
10056 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10057 __Pyx_INCREF(__pyx_t_4);
10058 __Pyx_INCREF(
function);
10059 __Pyx_DECREF_SET(__pyx_t_1,
function);
10063 __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10064 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10065 __Pyx_GOTREF(__pyx_t_2);
10067 __pyx_t_40 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10068 __Pyx_GOTREF(__pyx_t_40);
10069 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_4); __pyx_t_4 = NULL;
10070 __Pyx_GIVEREF(__pyx_t_5);
10071 PyTuple_SET_ITEM(__pyx_t_40, 0+1, __pyx_t_5);
10073 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_40, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10074 __Pyx_GOTREF(__pyx_t_2);
10075 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10077 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10078 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10079 __Pyx_GOTREF(__pyx_t_1);
10080 __pyx_t_40 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10081 __Pyx_GOTREF(__pyx_t_40);
10082 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10083 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10084 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_40);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 462; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10085 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10086 __pyx_v_u_eN = __pyx_t_7;
10095 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10096 __Pyx_GOTREF(__pyx_t_1);
10097 __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_sum);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10098 __Pyx_GOTREF(__pyx_t_2);
10099 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10100 __pyx_t_1 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10101 __Pyx_GOTREF(__pyx_t_1);
10103 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_2))) {
10104 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
10105 if (likely(__pyx_t_5)) {
10106 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_2);
10107 __Pyx_INCREF(__pyx_t_5);
10108 __Pyx_INCREF(
function);
10109 __Pyx_DECREF_SET(__pyx_t_2,
function);
10113 __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10114 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10115 __Pyx_GOTREF(__pyx_t_40);
10117 __pyx_t_4 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10118 __Pyx_GOTREF(__pyx_t_4);
10119 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
10120 __Pyx_GIVEREF(__pyx_t_1);
10121 PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_1);
10123 __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10124 __Pyx_GOTREF(__pyx_t_40);
10125 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10127 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10128 __pyx_t_2 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10129 __Pyx_GOTREF(__pyx_t_2);
10130 __pyx_t_4 = PyNumber_Multiply(__pyx_t_40, __pyx_t_2);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10131 __Pyx_GOTREF(__pyx_t_4);
10132 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10133 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10134 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 463; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10135 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10136 __pyx_v_kr_eN = __pyx_t_7;
10145 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_u_eN);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10146 __Pyx_GOTREF(__pyx_t_4);
10147 __pyx_t_40 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10148 __Pyx_GOTREF(__pyx_t_40);
10149 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_dot);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10150 __Pyx_GOTREF(__pyx_t_1);
10151 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10152 __pyx_t_40 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_40 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10153 __Pyx_GOTREF(__pyx_t_40);
10156 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
10157 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10158 if (likely(__pyx_t_5)) {
10159 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10160 __Pyx_INCREF(__pyx_t_5);
10161 __Pyx_INCREF(
function);
10162 __Pyx_DECREF_SET(__pyx_t_1,
function);
10166 __pyx_t_41 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10167 __Pyx_GOTREF(__pyx_t_41);
10169 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_5); __pyx_t_5 = NULL;
10171 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
10172 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
10173 PyTuple_SET_ITEM(__pyx_t_41, 0+__pyx_t_3, ((PyObject *)__pyx_v_gravity));
10174 __Pyx_GIVEREF(__pyx_t_40);
10175 PyTuple_SET_ITEM(__pyx_t_41, 1+__pyx_t_3, __pyx_t_40);
10177 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_41, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10178 __Pyx_GOTREF(__pyx_t_2);
10179 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
10180 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10181 __pyx_t_1 = PyNumber_Subtract(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10182 __Pyx_GOTREF(__pyx_t_1);
10183 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10184 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10185 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_1);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 465; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10186 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10187 __pyx_v_phi_eN = __pyx_t_7;
10196 __pyx_t_11 = __pyx_v_nElementBoundaries_element;
10197 for (__pyx_t_12 = 0; __pyx_t_12 < __pyx_t_11; __pyx_t_12+=1) {
10198 __pyx_v_ebN = __pyx_t_12;
10207 __pyx_t_42 = __pyx_v_eN;
10208 __pyx_t_43 = __pyx_v_ebN;
10210 if (__pyx_t_42 < 0) {
10211 __pyx_t_42 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
10212 if (unlikely(__pyx_t_42 < 0)) __pyx_t_15 = 0;
10213 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
10214 if (__pyx_t_43 < 0) {
10215 __pyx_t_43 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
10216 if (unlikely(__pyx_t_43 < 0)) __pyx_t_15 = 1;
10217 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
10218 if (unlikely(__pyx_t_15 != -1)) {
10219 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10220 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10222 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_43, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_eN;
10231 __pyx_t_44 = __pyx_v_eN;
10232 __pyx_t_45 = __pyx_v_ebN;
10234 if (__pyx_t_44 < 0) {
10235 __pyx_t_44 += __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape;
10236 if (unlikely(__pyx_t_44 < 0)) __pyx_t_15 = 0;
10237 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape)) __pyx_t_15 = 0;
10238 if (__pyx_t_45 < 0) {
10239 __pyx_t_45 += __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape;
10240 if (unlikely(__pyx_t_45 < 0)) __pyx_t_15 = 1;
10241 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape)) __pyx_t_15 = 1;
10242 if (unlikely(__pyx_t_15 != -1)) {
10243 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10244 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 472; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10246 __pyx_v_eN_neighbor = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides));
10255 __pyx_t_6 = ((__pyx_v_eN_neighbor >= 0) != 0);
10265 __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10266 __Pyx_GOTREF(__pyx_t_2);
10267 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_sum);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10268 __Pyx_GOTREF(__pyx_t_4);
10269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10270 __pyx_t_2 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_u), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10271 __Pyx_GOTREF(__pyx_t_2);
10273 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
10274 __pyx_t_41 = PyMethod_GET_SELF(__pyx_t_4);
10275 if (likely(__pyx_t_41)) {
10276 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10277 __Pyx_INCREF(__pyx_t_41);
10278 __Pyx_INCREF(
function);
10279 __Pyx_DECREF_SET(__pyx_t_4,
function);
10283 __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_2);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10284 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10285 __Pyx_GOTREF(__pyx_t_1);
10287 __pyx_t_40 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10288 __Pyx_GOTREF(__pyx_t_40);
10289 __Pyx_GIVEREF(__pyx_t_41); PyTuple_SET_ITEM(__pyx_t_40, 0, __pyx_t_41); __pyx_t_41 = NULL;
10290 __Pyx_GIVEREF(__pyx_t_2);
10291 PyTuple_SET_ITEM(__pyx_t_40, 0+1, __pyx_t_2);
10293 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_40, NULL);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10294 __Pyx_GOTREF(__pyx_t_1);
10295 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10297 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10298 __pyx_t_4 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10299 __Pyx_GOTREF(__pyx_t_4);
10300 __pyx_t_40 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10301 __Pyx_GOTREF(__pyx_t_40);
10302 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10303 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10304 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_40);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 474; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10305 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10306 __pyx_v_u_neig = __pyx_t_7;
10315 __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10316 __Pyx_GOTREF(__pyx_t_4);
10317 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_sum);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10318 __Pyx_GOTREF(__pyx_t_1);
10319 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10320 __pyx_t_4 = __Pyx_GetItemInt(((PyObject *)__pyx_v_q_kr), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10321 __Pyx_GOTREF(__pyx_t_4);
10323 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
10324 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_1);
10325 if (likely(__pyx_t_2)) {
10326 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
10327 __Pyx_INCREF(__pyx_t_2);
10328 __Pyx_INCREF(
function);
10329 __Pyx_DECREF_SET(__pyx_t_1,
function);
10333 __pyx_t_40 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_4);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10334 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10335 __Pyx_GOTREF(__pyx_t_40);
10337 __pyx_t_41 = PyTuple_New(1+1);
if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10338 __Pyx_GOTREF(__pyx_t_41);
10339 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_41, 0, __pyx_t_2); __pyx_t_2 = NULL;
10340 __Pyx_GIVEREF(__pyx_t_4);
10341 PyTuple_SET_ITEM(__pyx_t_41, 0+1, __pyx_t_4);
10343 __pyx_t_40 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_41, NULL);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10344 __Pyx_GOTREF(__pyx_t_40);
10345 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
10347 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10348 __pyx_t_1 = PyFloat_FromDouble(__pyx_v_nAvgWeight);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10349 __Pyx_GOTREF(__pyx_t_1);
10350 __pyx_t_41 = PyNumber_Multiply(__pyx_t_40, __pyx_t_1);
if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10351 __Pyx_GOTREF(__pyx_t_41);
10352 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10353 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10354 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_41);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 475; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10355 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
10356 __pyx_v_kr_neig = __pyx_t_7;
10365 __pyx_t_41 = PyFloat_FromDouble(__pyx_v_u_neig);
if (unlikely(!__pyx_t_41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10366 __Pyx_GOTREF(__pyx_t_41);
10367 __pyx_t_40 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10368 __Pyx_GOTREF(__pyx_t_40);
10369 __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_40, __pyx_n_s_dot);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10370 __Pyx_GOTREF(__pyx_t_4);
10371 __Pyx_DECREF(__pyx_t_40); __pyx_t_40 = 0;
10372 __pyx_t_40 = __Pyx_GetItemInt(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_v_eN_neighbor,
int, 1, __Pyx_PyInt_From_int, 0, 1, 1);
if (unlikely(__pyx_t_40 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
10373 __Pyx_GOTREF(__pyx_t_40);
10376 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_4))) {
10377 __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_4);
10378 if (likely(__pyx_t_2)) {
10379 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_4);
10380 __Pyx_INCREF(__pyx_t_2);
10381 __Pyx_INCREF(
function);
10382 __Pyx_DECREF_SET(__pyx_t_4,
function);
10386 __pyx_t_5 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10387 __Pyx_GOTREF(__pyx_t_5);
10389 __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
10391 __Pyx_INCREF(((PyObject *)__pyx_v_gravity));
10392 __Pyx_GIVEREF(((PyObject *)__pyx_v_gravity));
10393 PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_3, ((PyObject *)__pyx_v_gravity));
10394 __Pyx_GIVEREF(__pyx_t_40);
10395 PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_3, __pyx_t_40);
10397 __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10398 __Pyx_GOTREF(__pyx_t_1);
10399 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10400 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10401 __pyx_t_4 = PyNumber_Subtract(__pyx_t_41, __pyx_t_1);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10402 __Pyx_GOTREF(__pyx_t_4);
10403 __Pyx_DECREF(__pyx_t_41); __pyx_t_41 = 0;
10404 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10405 __pyx_t_7 = __pyx_PyFloat_AsDouble(__pyx_t_4);
if (unlikely((__pyx_t_7 == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 477; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10406 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10407 __pyx_v_phi_neig = __pyx_t_7;
10416 __pyx_t_6 = ((__pyx_v_phi_eN < __pyx_v_phi_neig) != 0);
10426 __pyx_t_46 = __pyx_v_eN;
10427 __pyx_t_47 = __pyx_v_ebN;
10429 if (__pyx_t_46 < 0) {
10430 __pyx_t_46 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
10431 if (unlikely(__pyx_t_46 < 0)) __pyx_t_15 = 0;
10432 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_15 = 0;
10433 if (__pyx_t_47 < 0) {
10434 __pyx_t_47 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
10435 if (unlikely(__pyx_t_47 < 0)) __pyx_t_15 = 1;
10436 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_15 = 1;
10437 if (unlikely(__pyx_t_15 != -1)) {
10438 __Pyx_RaiseBufferIndexError(__pyx_t_15);
10439 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10441 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_q_kr_up.diminfo[1].strides) = __pyx_v_kr_neig;
10472 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10475 __Pyx_XDECREF(__pyx_t_1);
10476 __Pyx_XDECREF(__pyx_t_2);
10477 __Pyx_XDECREF(__pyx_t_4);
10478 __Pyx_XDECREF(__pyx_t_5);
10479 __Pyx_XDECREF(__pyx_t_40);
10480 __Pyx_XDECREF(__pyx_t_41);
10481 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
10482 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
10483 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
10484 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
10485 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10486 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
10487 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
10488 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
10489 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
10490 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
10491 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
10492 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
10493 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
10494 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
10495 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
10496 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
10497 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
10498 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
10499 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
10500 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
10501 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
10502 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_evaluateElementCoefficients_VGM", __pyx_clineno, __pyx_lineno, __pyx_filename);
10506 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_alpha.rcbuffer->pybuffer);
10507 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
10508 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementMaterialTypes.rcbuffer->pybuffer);
10509 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
10510 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
10511 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
10512 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
10513 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmass.rcbuffer->pybuffer);
10514 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
10515 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
10516 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mass.rcbuffer->pybuffer);
10517 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
10518 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
10519 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_x.rcbuffer->pybuffer);
10520 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaR.rcbuffer->pybuffer);
10521 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_thetaSR.rcbuffer->pybuffer);
10522 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_dof.rcbuffer->pybuffer);
10523 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_u_l2g.rcbuffer->pybuffer);
10525 __Pyx_XDECREF(__pyx_v_q);
10526 __Pyx_XGIVEREF(__pyx_r);
10527 __Pyx_RefNannyFinishContext();
10540 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
10541 static char __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
10542 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual = {
"RE_NCP1_getElementResidual", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual};
10543 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10544 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
10545 PyArrayObject *__pyx_v_rowptr = 0;
10546 PyArrayObject *__pyx_v_colind = 0;
10547 int __pyx_v_nSpace;
10548 int __pyx_v_nElements_global;
10549 int __pyx_v_nElementBoundaries_element;
10550 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
10551 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
10552 int __pyx_v_nDOF_test_element;
10553 PyArrayObject *__pyx_v_q_u = 0;
10554 PyArrayObject *__pyx_v_q_grad_u = 0;
10555 PyArrayObject *__pyx_v_q_grad_w = 0;
10556 PyArrayObject *__pyx_v_q_detJ = 0;
10557 PyArrayObject *__pyx_v_q_m = 0;
10558 PyArrayObject *__pyx_v_q_mt = 0;
10559 PyArrayObject *__pyx_v_q_r = 0;
10560 PyArrayObject *__pyx_v_q_kr = 0;
10561 PyArrayObject *__pyx_v_q_kr_up = 0;
10562 PyArrayObject *__pyx_v_q_flin = 0;
10563 PyArrayObject *__pyx_v_q_alin = 0;
10564 PyArrayObject *__pyx_v_elementResidual = 0;
10565 int __pyx_lineno = 0;
10566 const char *__pyx_filename = NULL;
10567 int __pyx_clineno = 0;
10568 PyObject *__pyx_r = 0;
10569 __Pyx_RefNannyDeclarations
10570 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual (wrapper)", 0);
10572 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_mt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementResidual,0};
10573 PyObject* values[21] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
10574 if (unlikely(__pyx_kwds)) {
10575 Py_ssize_t kw_args;
10576 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10577 switch (pos_args) {
10578 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10579 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10580 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10581 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10582 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10583 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10584 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10585 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10586 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10587 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10588 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10589 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10590 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10591 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10592 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10593 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10594 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10595 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10596 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10597 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10598 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10600 default:
goto __pyx_L5_argtuple_error;
10602 kw_args = PyDict_Size(__pyx_kwds);
10603 switch (pos_args) {
10605 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
10606 else goto __pyx_L5_argtuple_error;
10608 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
10610 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10613 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
10615 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10618 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
10620 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10623 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
10625 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10628 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
10630 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10633 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
10635 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10638 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
10640 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10643 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
10645 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10648 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
10650 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10653 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
10655 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10658 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
10660 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10663 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
10665 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10668 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
10670 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10673 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
10675 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10678 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
10680 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10683 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
10685 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10688 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
10690 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10693 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
10695 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10698 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
10700 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10703 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementResidual)) != 0)) kw_args--;
10705 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10708 if (unlikely(kw_args > 0)) {
10709 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementResidual") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10711 }
else if (PyTuple_GET_SIZE(__pyx_args) != 21) {
10712 goto __pyx_L5_argtuple_error;
10714 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10715 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10716 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10717 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10718 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10719 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10720 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10721 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
10722 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
10723 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
10724 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
10725 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
10726 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
10727 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
10728 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
10729 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
10730 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
10731 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
10732 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
10733 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
10734 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
10736 __pyx_v_gravity = ((PyArrayObject *)values[0]);
10737 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
10738 __pyx_v_colind = ((PyArrayObject *)values[2]);
10739 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10740 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 491; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10741 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10742 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
10743 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
10744 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 496; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10745 __pyx_v_q_u = ((PyArrayObject *)values[9]);
10746 __pyx_v_q_grad_u = ((PyArrayObject *)values[10]);
10747 __pyx_v_q_grad_w = ((PyArrayObject *)values[11]);
10748 __pyx_v_q_detJ = ((PyArrayObject *)values[12]);
10749 __pyx_v_q_m = ((PyArrayObject *)values[13]);
10750 __pyx_v_q_mt = ((PyArrayObject *)values[14]);
10751 __pyx_v_q_r = ((PyArrayObject *)values[15]);
10752 __pyx_v_q_kr = ((PyArrayObject *)values[16]);
10753 __pyx_v_q_kr_up = ((PyArrayObject *)values[17]);
10754 __pyx_v_q_flin = ((PyArrayObject *)values[18]);
10755 __pyx_v_q_alin = ((PyArrayObject *)values[19]);
10756 __pyx_v_elementResidual = ((PyArrayObject *)values[20]);
10758 goto __pyx_L4_argument_unpacking_done;
10759 __pyx_L5_argtuple_error:;
10760 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementResidual", 1, 21, 21, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
10762 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
10763 __Pyx_RefNannyFinishContext();
10765 __pyx_L4_argument_unpacking_done:;
10766 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10767 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 487; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10768 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 488; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10769 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 493; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10770 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 494; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10771 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10772 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 498; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10773 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 499; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10774 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 501; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10775 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 502; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10776 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 503; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10777 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 504; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10778 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 505; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10779 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 506; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10780 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 509; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10781 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 510; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10782 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementResidual), __pyx_ptype_5numpy_ndarray, 1,
"elementResidual", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 512; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10783 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_mt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementResidual);
10790 __Pyx_RefNannyFinishContext();
10794 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_32RE_NCP1_getElementResidual(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element, PyArrayObject *__pyx_v_q_u, PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementResidual) {
10795 CYTHON_UNUSED
int __pyx_v_upwindFlag;
10796 PyObject *__pyx_v_q = NULL;
10803 PyArrayObject *__pyx_v_a_up = 0;
10804 PyArrayObject *__pyx_v_f_up = 0;
10805 double __pyx_v_nAvgWeight;
10806 double __pyx_v_weight;
10807 double __pyx_v_volFactor;
10808 double __pyx_v_volume;
10809 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
10810 __Pyx_Buffer __pyx_pybuffer_a_up;
10811 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
10812 __Pyx_Buffer __pyx_pybuffer_colind;
10813 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
10814 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
10815 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
10816 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
10817 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementResidual;
10818 __Pyx_Buffer __pyx_pybuffer_elementResidual;
10819 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
10820 __Pyx_Buffer __pyx_pybuffer_f_up;
10821 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
10822 __Pyx_Buffer __pyx_pybuffer_gravity;
10823 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
10824 __Pyx_Buffer __pyx_pybuffer_q_alin;
10825 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
10826 __Pyx_Buffer __pyx_pybuffer_q_detJ;
10827 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
10828 __Pyx_Buffer __pyx_pybuffer_q_flin;
10829 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
10830 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
10831 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
10832 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
10833 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
10834 __Pyx_Buffer __pyx_pybuffer_q_kr;
10835 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
10836 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
10837 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
10838 __Pyx_Buffer __pyx_pybuffer_q_m;
10839 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
10840 __Pyx_Buffer __pyx_pybuffer_q_mt;
10841 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
10842 __Pyx_Buffer __pyx_pybuffer_q_r;
10843 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
10844 __Pyx_Buffer __pyx_pybuffer_q_u;
10845 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
10846 __Pyx_Buffer __pyx_pybuffer_rowptr;
10847 PyObject *__pyx_r = NULL;
10848 __Pyx_RefNannyDeclarations
10849 PyObject *__pyx_t_1 = NULL;
10850 PyObject *__pyx_t_2 = NULL;
10851 Py_ssize_t __pyx_t_3;
10852 PyObject *__pyx_t_4 = NULL;
10853 PyObject *__pyx_t_5 = NULL;
10855 Py_ssize_t __pyx_t_7;
10857 PyObject *__pyx_t_9 = NULL;
10858 PyArrayObject *__pyx_t_10 = NULL;
10859 PyArrayObject *__pyx_t_11 = NULL;
10862 Py_ssize_t __pyx_t_14;
10863 Py_ssize_t __pyx_t_15;
10866 Py_ssize_t __pyx_t_18;
10867 Py_ssize_t __pyx_t_19;
10869 Py_ssize_t __pyx_t_21;
10870 Py_ssize_t __pyx_t_22;
10871 Py_ssize_t __pyx_t_23;
10872 Py_ssize_t __pyx_t_24;
10873 Py_ssize_t __pyx_t_25;
10874 Py_ssize_t __pyx_t_26;
10878 Py_ssize_t __pyx_t_30;
10879 Py_ssize_t __pyx_t_31;
10880 Py_ssize_t __pyx_t_32;
10882 Py_ssize_t __pyx_t_34;
10883 Py_ssize_t __pyx_t_35;
10884 Py_ssize_t __pyx_t_36;
10885 Py_ssize_t __pyx_t_37;
10886 Py_ssize_t __pyx_t_38;
10887 Py_ssize_t __pyx_t_39;
10888 Py_ssize_t __pyx_t_40;
10889 Py_ssize_t __pyx_t_41;
10890 Py_ssize_t __pyx_t_42;
10891 Py_ssize_t __pyx_t_43;
10892 Py_ssize_t __pyx_t_44;
10893 Py_ssize_t __pyx_t_45;
10894 Py_ssize_t __pyx_t_46;
10895 Py_ssize_t __pyx_t_47;
10896 Py_ssize_t __pyx_t_48;
10897 Py_ssize_t __pyx_t_49;
10898 Py_ssize_t __pyx_t_50;
10899 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_51;
10900 Py_ssize_t __pyx_t_52;
10901 Py_ssize_t __pyx_t_53;
10903 Py_ssize_t __pyx_t_55;
10904 Py_ssize_t __pyx_t_56;
10905 Py_ssize_t __pyx_t_57;
10906 Py_ssize_t __pyx_t_58;
10907 Py_ssize_t __pyx_t_59;
10908 Py_ssize_t __pyx_t_60;
10909 Py_ssize_t __pyx_t_61;
10910 Py_ssize_t __pyx_t_62;
10911 Py_ssize_t __pyx_t_63;
10912 Py_ssize_t __pyx_t_64;
10913 int __pyx_lineno = 0;
10914 const char *__pyx_filename = NULL;
10915 int __pyx_clineno = 0;
10916 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementResidual", 0);
10917 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
10918 __pyx_pybuffer_a_up.refcount = 0;
10919 __pyx_pybuffernd_a_up.data = NULL;
10920 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
10921 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
10922 __pyx_pybuffer_f_up.refcount = 0;
10923 __pyx_pybuffernd_f_up.data = NULL;
10924 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
10925 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
10926 __pyx_pybuffer_gravity.refcount = 0;
10927 __pyx_pybuffernd_gravity.data = NULL;
10928 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
10929 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
10930 __pyx_pybuffer_rowptr.refcount = 0;
10931 __pyx_pybuffernd_rowptr.data = NULL;
10932 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
10933 __pyx_pybuffer_colind.pybuffer.buf = NULL;
10934 __pyx_pybuffer_colind.refcount = 0;
10935 __pyx_pybuffernd_colind.data = NULL;
10936 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
10937 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
10938 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
10939 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
10940 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
10941 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
10942 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
10943 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
10944 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
10945 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
10946 __pyx_pybuffer_q_u.refcount = 0;
10947 __pyx_pybuffernd_q_u.data = NULL;
10948 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
10949 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
10950 __pyx_pybuffer_q_grad_u.refcount = 0;
10951 __pyx_pybuffernd_q_grad_u.data = NULL;
10952 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
10953 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
10954 __pyx_pybuffer_q_grad_w.refcount = 0;
10955 __pyx_pybuffernd_q_grad_w.data = NULL;
10956 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
10957 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
10958 __pyx_pybuffer_q_detJ.refcount = 0;
10959 __pyx_pybuffernd_q_detJ.data = NULL;
10960 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
10961 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
10962 __pyx_pybuffer_q_m.refcount = 0;
10963 __pyx_pybuffernd_q_m.data = NULL;
10964 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
10965 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
10966 __pyx_pybuffer_q_mt.refcount = 0;
10967 __pyx_pybuffernd_q_mt.data = NULL;
10968 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
10969 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
10970 __pyx_pybuffer_q_r.refcount = 0;
10971 __pyx_pybuffernd_q_r.data = NULL;
10972 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
10973 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
10974 __pyx_pybuffer_q_kr.refcount = 0;
10975 __pyx_pybuffernd_q_kr.data = NULL;
10976 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
10977 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
10978 __pyx_pybuffer_q_kr_up.refcount = 0;
10979 __pyx_pybuffernd_q_kr_up.data = NULL;
10980 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
10981 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
10982 __pyx_pybuffer_q_flin.refcount = 0;
10983 __pyx_pybuffernd_q_flin.data = NULL;
10984 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
10985 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
10986 __pyx_pybuffer_q_alin.refcount = 0;
10987 __pyx_pybuffernd_q_alin.data = NULL;
10988 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
10989 __pyx_pybuffer_elementResidual.pybuffer.buf = NULL;
10990 __pyx_pybuffer_elementResidual.refcount = 0;
10991 __pyx_pybuffernd_elementResidual.data = NULL;
10992 __pyx_pybuffernd_elementResidual.rcbuffer = &__pyx_pybuffer_elementResidual;
10994 __Pyx_BufFmt_StackElem __pyx_stack[1];
10995 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
10997 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
10999 __Pyx_BufFmt_StackElem __pyx_stack[1];
11000 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11002 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
11004 __Pyx_BufFmt_StackElem __pyx_stack[1];
11005 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11007 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
11009 __Pyx_BufFmt_StackElem __pyx_stack[1];
11010 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11012 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
11014 __Pyx_BufFmt_StackElem __pyx_stack[1];
11015 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11017 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
11019 __Pyx_BufFmt_StackElem __pyx_stack[1];
11020 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11022 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
11024 __Pyx_BufFmt_StackElem __pyx_stack[1];
11025 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11027 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
11029 __Pyx_BufFmt_StackElem __pyx_stack[1];
11030 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11032 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
11034 __Pyx_BufFmt_StackElem __pyx_stack[1];
11035 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11037 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
11039 __Pyx_BufFmt_StackElem __pyx_stack[1];
11040 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11042 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
11044 __Pyx_BufFmt_StackElem __pyx_stack[1];
11045 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11047 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
11049 __Pyx_BufFmt_StackElem __pyx_stack[1];
11050 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11052 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
11054 __Pyx_BufFmt_StackElem __pyx_stack[1];
11055 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11057 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
11059 __Pyx_BufFmt_StackElem __pyx_stack[1];
11060 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11062 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
11064 __Pyx_BufFmt_StackElem __pyx_stack[1];
11065 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11067 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
11069 __Pyx_BufFmt_StackElem __pyx_stack[1];
11070 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11072 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
11074 __Pyx_BufFmt_StackElem __pyx_stack[1];
11075 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementResidual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11077 __pyx_pybuffernd_elementResidual.diminfo[0].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementResidual.diminfo[0].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementResidual.diminfo[1].strides = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementResidual.diminfo[1].shape = __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.shape[1];
11086 __pyx_v_upwindFlag = 1;
11095 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11096 __Pyx_GOTREF(__pyx_t_1);
11097 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
11098 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
11099 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
11100 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
11101 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
11102 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
11103 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
11104 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
11105 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
11106 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
11107 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
11108 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
11109 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
11110 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
11111 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
11112 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
11113 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11115 if (__pyx_t_3 >= 5)
break;
11116 #if CYTHON_COMPILING_IN_CPYTHON
11117 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11119 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11120 __Pyx_GOTREF(__pyx_t_1);
11122 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
11132 #ifndef CYTHON_WITHOUT_ASSERTIONS
11133 if (unlikely(!Py_OptimizeFlag)) {
11134 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11135 __Pyx_GOTREF(__pyx_t_1);
11136 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
11137 __Pyx_GOTREF(__pyx_t_4);
11138 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11139 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11140 __Pyx_GOTREF(__pyx_t_1);
11141 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11142 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11143 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11144 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11145 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11146 if (unlikely(!__pyx_t_6)) {
11147 PyErr_SetNone(PyExc_AssertionError);
11148 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 530; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11161 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11170 #ifndef CYTHON_WITHOUT_ASSERTIONS
11171 if (unlikely(!Py_OptimizeFlag)) {
11172 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
11173 PyErr_SetNone(PyExc_AssertionError);
11174 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11186 __pyx_t_7 = __pyx_v_nSpace;
11188 if (__pyx_t_7 < 0) {
11189 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
11190 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
11191 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
11192 if (unlikely(__pyx_t_8 != -1)) {
11193 __Pyx_RaiseBufferIndexError(__pyx_t_8);
11194 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 532; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11196 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
11205 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11206 __Pyx_GOTREF(__pyx_t_5);
11207 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11208 __Pyx_GOTREF(__pyx_t_1);
11209 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11210 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11211 __Pyx_GOTREF(__pyx_t_5);
11214 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
11215 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
11216 if (likely(__pyx_t_4)) {
11217 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
11218 __Pyx_INCREF(__pyx_t_4);
11219 __Pyx_INCREF(
function);
11220 __Pyx_DECREF_SET(__pyx_t_1,
function);
11224 __pyx_t_9 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11225 __Pyx_GOTREF(__pyx_t_9);
11227 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
11229 __Pyx_GIVEREF(__pyx_t_5);
11230 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_3, __pyx_t_5);
11231 __Pyx_INCREF(__pyx_n_s_d);
11232 __Pyx_GIVEREF(__pyx_n_s_d);
11233 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_3, __pyx_n_s_d);
11235 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11236 __Pyx_GOTREF(__pyx_t_2);
11237 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11238 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11239 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11240 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
11242 __Pyx_BufFmt_StackElem __pyx_stack[1];
11243 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11244 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
11245 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 536; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11246 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
11250 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
11260 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11261 __Pyx_GOTREF(__pyx_t_1);
11262 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11263 __Pyx_GOTREF(__pyx_t_9);
11264 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11265 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11266 __Pyx_GOTREF(__pyx_t_1);
11269 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
11270 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
11271 if (likely(__pyx_t_5)) {
11272 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
11273 __Pyx_INCREF(__pyx_t_5);
11274 __Pyx_INCREF(
function);
11275 __Pyx_DECREF_SET(__pyx_t_9,
function);
11279 __pyx_t_4 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11280 __Pyx_GOTREF(__pyx_t_4);
11282 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
11284 __Pyx_GIVEREF(__pyx_t_1);
11285 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_3, __pyx_t_1);
11286 __Pyx_INCREF(__pyx_n_s_d);
11287 __Pyx_GIVEREF(__pyx_n_s_d);
11288 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_3, __pyx_n_s_d);
11290 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11291 __Pyx_GOTREF(__pyx_t_2);
11292 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11293 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
11294 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11295 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
11297 __Pyx_BufFmt_StackElem __pyx_stack[1];
11298 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
11299 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
11300 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11301 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
11305 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
11315 __pyx_t_12 = (__pyx_v_nSpace + 1.);
11316 if (unlikely(__pyx_t_12 == 0)) {
11317 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
11318 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11320 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
11329 __pyx_v_weight = 1.0;
11330 __pyx_v_volFactor = 1.0;
11339 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
11349 __pyx_v_volFactor = 0.5;
11367 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
11377 __pyx_v_volFactor = (1.0 / 6.0);
11395 __pyx_t_8 = __pyx_v_nElements_global;
11396 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
11397 __pyx_v_eN = __pyx_t_13;
11406 __pyx_t_14 = __pyx_v_eN;
11409 if (__pyx_t_14 < 0) {
11410 __pyx_t_14 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
11411 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
11412 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
11413 if (__pyx_t_15 < 0) {
11414 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
11415 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
11416 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
11417 if (unlikely(__pyx_t_16 != -1)) {
11418 __Pyx_RaiseBufferIndexError(__pyx_t_16);
11419 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 547; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11421 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
11430 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
11439 __pyx_t_16 = __pyx_v_nDOF_test_element;
11440 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
11441 __pyx_v_i = __pyx_t_17;
11450 __pyx_t_18 = __pyx_v_eN;
11451 __pyx_t_19 = __pyx_v_i;
11453 if (__pyx_t_18 < 0) {
11454 __pyx_t_18 += __pyx_pybuffernd_q_mt.diminfo[0].shape;
11455 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
11456 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_mt.diminfo[0].shape)) __pyx_t_20 = 0;
11457 if (__pyx_t_19 < 0) {
11458 __pyx_t_19 += __pyx_pybuffernd_q_mt.diminfo[1].shape;
11459 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
11460 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_mt.diminfo[1].shape)) __pyx_t_20 = 1;
11461 if (unlikely(__pyx_t_20 != -1)) {
11462 __Pyx_RaiseBufferIndexError(__pyx_t_20);
11463 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11465 __pyx_t_21 = __pyx_v_eN;
11466 __pyx_t_22 = __pyx_v_i;
11468 if (__pyx_t_21 < 0) {
11469 __pyx_t_21 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
11470 if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
11471 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_20 = 0;
11472 if (__pyx_t_22 < 0) {
11473 __pyx_t_22 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
11474 if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 1;
11475 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_20 = 1;
11476 if (unlikely(__pyx_t_20 != -1)) {
11477 __Pyx_RaiseBufferIndexError(__pyx_t_20);
11478 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 553; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11480 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_q_mt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_mt.diminfo[1].strides)));
11489 __pyx_t_23 = __pyx_v_eN;
11490 __pyx_t_24 = __pyx_v_i;
11492 if (__pyx_t_23 < 0) {
11493 __pyx_t_23 += __pyx_pybuffernd_q_r.diminfo[0].shape;
11494 if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 0;
11495 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_q_r.diminfo[0].shape)) __pyx_t_20 = 0;
11496 if (__pyx_t_24 < 0) {
11497 __pyx_t_24 += __pyx_pybuffernd_q_r.diminfo[1].shape;
11498 if (unlikely(__pyx_t_24 < 0)) __pyx_t_20 = 1;
11499 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_q_r.diminfo[1].shape)) __pyx_t_20 = 1;
11500 if (unlikely(__pyx_t_20 != -1)) {
11501 __Pyx_RaiseBufferIndexError(__pyx_t_20);
11502 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11504 __pyx_t_25 = __pyx_v_eN;
11505 __pyx_t_26 = __pyx_v_i;
11507 if (__pyx_t_25 < 0) {
11508 __pyx_t_25 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
11509 if (unlikely(__pyx_t_25 < 0)) __pyx_t_20 = 0;
11510 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_20 = 0;
11511 if (__pyx_t_26 < 0) {
11512 __pyx_t_26 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
11513 if (unlikely(__pyx_t_26 < 0)) __pyx_t_20 = 1;
11514 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_20 = 1;
11515 if (unlikely(__pyx_t_20 != -1)) {
11516 __Pyx_RaiseBufferIndexError(__pyx_t_20);
11517 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 555; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11519 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_r.rcbuffer->pybuffer.buf, __pyx_t_23, __pyx_pybuffernd_q_r.diminfo[0].strides, __pyx_t_24, __pyx_pybuffernd_q_r.diminfo[1].strides)));
11528 __pyx_t_20 = __pyx_v_nElementBoundaries_element;
11529 for (__pyx_t_27 = 0; __pyx_t_27 < __pyx_t_20; __pyx_t_27+=1) {
11530 __pyx_v_ebN = __pyx_t_27;
11539 __pyx_t_28 = __pyx_v_nnz;
11540 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
11541 __pyx_v_ii = __pyx_t_29;
11550 __pyx_t_30 = __pyx_v_eN;
11551 __pyx_t_31 = __pyx_v_ebN;
11552 __pyx_t_32 = __pyx_v_ii;
11554 if (__pyx_t_30 < 0) {
11555 __pyx_t_30 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
11556 if (unlikely(__pyx_t_30 < 0)) __pyx_t_33 = 0;
11557 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_33 = 0;
11558 if (__pyx_t_31 < 0) {
11559 __pyx_t_31 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
11560 if (unlikely(__pyx_t_31 < 0)) __pyx_t_33 = 1;
11561 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_33 = 1;
11562 if (__pyx_t_32 < 0) {
11563 __pyx_t_32 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
11564 if (unlikely(__pyx_t_32 < 0)) __pyx_t_33 = 2;
11565 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_33 = 2;
11566 if (unlikely(__pyx_t_33 != -1)) {
11567 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11568 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11570 __pyx_t_34 = __pyx_v_eN;
11571 __pyx_t_35 = __pyx_v_ebN;
11573 if (__pyx_t_34 < 0) {
11574 __pyx_t_34 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11575 if (unlikely(__pyx_t_34 < 0)) __pyx_t_33 = 0;
11576 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_33 = 0;
11577 if (__pyx_t_35 < 0) {
11578 __pyx_t_35 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11579 if (unlikely(__pyx_t_35 < 0)) __pyx_t_33 = 1;
11580 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_33 = 1;
11581 if (unlikely(__pyx_t_33 != -1)) {
11582 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11583 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11585 __pyx_t_36 = __pyx_v_ii;
11587 if (__pyx_t_36 < 0) {
11588 __pyx_t_36 += __pyx_pybuffernd_a_up.diminfo[0].shape;
11589 if (unlikely(__pyx_t_36 < 0)) __pyx_t_33 = 0;
11590 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_33 = 0;
11591 if (unlikely(__pyx_t_33 != -1)) {
11592 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11593 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 561; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11595 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_30, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_31, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_32, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
11605 __pyx_t_28 = __pyx_v_nSpace;
11606 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
11607 __pyx_v_I = __pyx_t_29;
11616 __pyx_t_37 = __pyx_v_eN;
11617 __pyx_t_38 = __pyx_v_ebN;
11618 __pyx_t_39 = __pyx_v_I;
11620 if (__pyx_t_37 < 0) {
11621 __pyx_t_37 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
11622 if (unlikely(__pyx_t_37 < 0)) __pyx_t_33 = 0;
11623 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_33 = 0;
11624 if (__pyx_t_38 < 0) {
11625 __pyx_t_38 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
11626 if (unlikely(__pyx_t_38 < 0)) __pyx_t_33 = 1;
11627 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_33 = 1;
11628 if (__pyx_t_39 < 0) {
11629 __pyx_t_39 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
11630 if (unlikely(__pyx_t_39 < 0)) __pyx_t_33 = 2;
11631 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_33 = 2;
11632 if (unlikely(__pyx_t_33 != -1)) {
11633 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11634 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11636 __pyx_t_40 = __pyx_v_eN;
11637 __pyx_t_41 = __pyx_v_ebN;
11639 if (__pyx_t_40 < 0) {
11640 __pyx_t_40 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
11641 if (unlikely(__pyx_t_40 < 0)) __pyx_t_33 = 0;
11642 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_33 = 0;
11643 if (__pyx_t_41 < 0) {
11644 __pyx_t_41 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
11645 if (unlikely(__pyx_t_41 < 0)) __pyx_t_33 = 1;
11646 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_33 = 1;
11647 if (unlikely(__pyx_t_33 != -1)) {
11648 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11649 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11651 __pyx_t_42 = __pyx_v_I;
11653 if (__pyx_t_42 < 0) {
11654 __pyx_t_42 += __pyx_pybuffernd_f_up.diminfo[0].shape;
11655 if (unlikely(__pyx_t_42 < 0)) __pyx_t_33 = 0;
11656 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_33 = 0;
11657 if (unlikely(__pyx_t_33 != -1)) {
11658 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11659 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 563; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11661 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_42, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
11671 __pyx_t_28 = __pyx_v_nSpace;
11672 for (__pyx_t_29 = 0; __pyx_t_29 < __pyx_t_28; __pyx_t_29+=1) {
11673 __pyx_v_I = __pyx_t_29;
11682 __pyx_t_43 = __pyx_v_I;
11684 if (__pyx_t_43 < 0) {
11685 __pyx_t_43 += __pyx_pybuffernd_f_up.diminfo[0].shape;
11686 if (unlikely(__pyx_t_43 < 0)) __pyx_t_33 = 0;
11687 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_33 = 0;
11688 if (unlikely(__pyx_t_33 != -1)) {
11689 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11690 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11692 __pyx_t_44 = __pyx_v_eN;
11693 __pyx_t_45 = __pyx_v_ebN;
11694 __pyx_t_46 = __pyx_v_i;
11695 __pyx_t_47 = __pyx_v_I;
11697 if (__pyx_t_44 < 0) {
11698 __pyx_t_44 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
11699 if (unlikely(__pyx_t_44 < 0)) __pyx_t_33 = 0;
11700 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_33 = 0;
11701 if (__pyx_t_45 < 0) {
11702 __pyx_t_45 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
11703 if (unlikely(__pyx_t_45 < 0)) __pyx_t_33 = 1;
11704 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_33 = 1;
11705 if (__pyx_t_46 < 0) {
11706 __pyx_t_46 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
11707 if (unlikely(__pyx_t_46 < 0)) __pyx_t_33 = 2;
11708 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_33 = 2;
11709 if (__pyx_t_47 < 0) {
11710 __pyx_t_47 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
11711 if (unlikely(__pyx_t_47 < 0)) __pyx_t_33 = 3;
11712 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_33 = 3;
11713 if (unlikely(__pyx_t_33 != -1)) {
11714 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11715 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11717 __pyx_t_48 = __pyx_v_eN;
11718 __pyx_t_49 = __pyx_v_i;
11720 if (__pyx_t_48 < 0) {
11721 __pyx_t_48 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
11722 if (unlikely(__pyx_t_48 < 0)) __pyx_t_33 = 0;
11723 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_33 = 0;
11724 if (__pyx_t_49 < 0) {
11725 __pyx_t_49 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
11726 if (unlikely(__pyx_t_49 < 0)) __pyx_t_33 = 1;
11727 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_33 = 1;
11728 if (unlikely(__pyx_t_33 != -1)) {
11729 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11730 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 567; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11732 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_elementResidual.diminfo[1].strides) -= ((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_f_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_45, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_46, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_47, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
11741 __pyx_t_50 = (__pyx_v_I + 1);
11743 if (__pyx_t_50 < 0) {
11744 __pyx_t_50 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
11745 if (unlikely(__pyx_t_50 < 0)) __pyx_t_33 = 0;
11746 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_33 = 0;
11747 if (unlikely(__pyx_t_33 != -1)) {
11748 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11749 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11751 __pyx_t_51 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_50, __pyx_pybuffernd_rowptr.diminfo[0].strides));
11752 __pyx_t_52 = __pyx_v_I;
11754 if (__pyx_t_52 < 0) {
11755 __pyx_t_52 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
11756 if (unlikely(__pyx_t_52 < 0)) __pyx_t_33 = 0;
11757 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_33 = 0;
11758 if (unlikely(__pyx_t_33 != -1)) {
11759 __Pyx_RaiseBufferIndexError(__pyx_t_33);
11760 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 568; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11762 for (__pyx_t_33 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_33 < __pyx_t_51; __pyx_t_33+=1) {
11763 __pyx_v_ii = __pyx_t_33;
11772 __pyx_t_53 = __pyx_v_ii;
11774 if (__pyx_t_53 < 0) {
11775 __pyx_t_53 += __pyx_pybuffernd_a_up.diminfo[0].shape;
11776 if (unlikely(__pyx_t_53 < 0)) __pyx_t_54 = 0;
11777 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_54 = 0;
11778 if (unlikely(__pyx_t_54 != -1)) {
11779 __Pyx_RaiseBufferIndexError(__pyx_t_54);
11780 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11782 __pyx_t_55 = __pyx_v_ii;
11784 if (__pyx_t_55 < 0) {
11785 __pyx_t_55 += __pyx_pybuffernd_colind.diminfo[0].shape;
11786 if (unlikely(__pyx_t_55 < 0)) __pyx_t_54 = 0;
11787 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_54 = 0;
11788 if (unlikely(__pyx_t_54 != -1)) {
11789 __Pyx_RaiseBufferIndexError(__pyx_t_54);
11790 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11792 __pyx_t_56 = __pyx_v_eN;
11793 __pyx_t_57 = __pyx_v_ebN;
11794 __pyx_t_58 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_colind.diminfo[0].strides));
11796 if (__pyx_t_56 < 0) {
11797 __pyx_t_56 += __pyx_pybuffernd_q_grad_u.diminfo[0].shape;
11798 if (unlikely(__pyx_t_56 < 0)) __pyx_t_54 = 0;
11799 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_q_grad_u.diminfo[0].shape)) __pyx_t_54 = 0;
11800 if (__pyx_t_57 < 0) {
11801 __pyx_t_57 += __pyx_pybuffernd_q_grad_u.diminfo[1].shape;
11802 if (unlikely(__pyx_t_57 < 0)) __pyx_t_54 = 1;
11803 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_q_grad_u.diminfo[1].shape)) __pyx_t_54 = 1;
11804 if (__pyx_t_58 < 0) {
11805 __pyx_t_58 += __pyx_pybuffernd_q_grad_u.diminfo[2].shape;
11806 if (unlikely(__pyx_t_58 < 0)) __pyx_t_54 = 2;
11807 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_q_grad_u.diminfo[2].shape)) __pyx_t_54 = 2;
11808 if (unlikely(__pyx_t_54 != -1)) {
11809 __Pyx_RaiseBufferIndexError(__pyx_t_54);
11810 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11812 __pyx_t_59 = __pyx_v_eN;
11813 __pyx_t_60 = __pyx_v_ebN;
11814 __pyx_t_61 = __pyx_v_i;
11815 __pyx_t_62 = __pyx_v_I;
11817 if (__pyx_t_59 < 0) {
11818 __pyx_t_59 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
11819 if (unlikely(__pyx_t_59 < 0)) __pyx_t_54 = 0;
11820 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_54 = 0;
11821 if (__pyx_t_60 < 0) {
11822 __pyx_t_60 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
11823 if (unlikely(__pyx_t_60 < 0)) __pyx_t_54 = 1;
11824 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_54 = 1;
11825 if (__pyx_t_61 < 0) {
11826 __pyx_t_61 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
11827 if (unlikely(__pyx_t_61 < 0)) __pyx_t_54 = 2;
11828 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_54 = 2;
11829 if (__pyx_t_62 < 0) {
11830 __pyx_t_62 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
11831 if (unlikely(__pyx_t_62 < 0)) __pyx_t_54 = 3;
11832 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_54 = 3;
11833 if (unlikely(__pyx_t_54 != -1)) {
11834 __Pyx_RaiseBufferIndexError(__pyx_t_54);
11835 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11837 __pyx_t_63 = __pyx_v_eN;
11838 __pyx_t_64 = __pyx_v_i;
11840 if (__pyx_t_63 < 0) {
11841 __pyx_t_63 += __pyx_pybuffernd_elementResidual.diminfo[0].shape;
11842 if (unlikely(__pyx_t_63 < 0)) __pyx_t_54 = 0;
11843 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_elementResidual.diminfo[0].shape)) __pyx_t_54 = 0;
11844 if (__pyx_t_64 < 0) {
11845 __pyx_t_64 += __pyx_pybuffernd_elementResidual.diminfo[1].shape;
11846 if (unlikely(__pyx_t_64 < 0)) __pyx_t_54 = 1;
11847 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_elementResidual.diminfo[1].shape)) __pyx_t_54 = 1;
11848 if (unlikely(__pyx_t_54 != -1)) {
11849 __Pyx_RaiseBufferIndexError(__pyx_t_54);
11850 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 569; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
11852 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementResidual.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_elementResidual.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_elementResidual.diminfo[1].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_53, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_q_grad_u.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_q_grad_u.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_q_grad_u.diminfo[2].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_61, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_62, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
11868 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11871 __Pyx_XDECREF(__pyx_t_1);
11872 __Pyx_XDECREF(__pyx_t_2);
11873 __Pyx_XDECREF(__pyx_t_4);
11874 __Pyx_XDECREF(__pyx_t_5);
11875 __Pyx_XDECREF(__pyx_t_9);
11876 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
11877 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
11878 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
11879 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
11880 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11881 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11882 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
11883 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
11884 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11885 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
11886 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
11887 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
11888 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
11889 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
11890 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11891 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11892 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
11893 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
11894 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11895 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11896 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
11897 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
11898 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementResidual", __pyx_clineno, __pyx_lineno, __pyx_filename);
11902 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
11903 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
11904 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
11905 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
11906 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementResidual.rcbuffer->pybuffer);
11907 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
11908 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
11909 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
11910 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
11911 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
11912 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
11913 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
11914 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
11915 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
11916 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
11917 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
11918 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
11919 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
11920 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
11922 __Pyx_XDECREF(__pyx_v_q);
11923 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
11924 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
11925 __Pyx_XGIVEREF(__pyx_r);
11926 __Pyx_RefNannyFinishContext();
11939 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
11940 static char __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian[] =
"\n residual routine for NCP1 approximation for conservative head formulation of Richards equation \n\n Approximation:\n uses nodal quadrature where the nodes are face barycenters\n uses harmonic average for intrinsic permeability/ hydraulic conductivity\n upwinds relative permeability based on element averages\n applies dirichlet boundary conditions strongly but keeps dofs in system\n\n TODO:\n everything\n \n ";
11941 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian = {
"RE_NCP1_getElementJacobian", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian};
11942 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
11943 CYTHON_UNUSED PyArrayObject *__pyx_v_gravity = 0;
11944 PyArrayObject *__pyx_v_rowptr = 0;
11945 PyArrayObject *__pyx_v_colind = 0;
11946 int __pyx_v_nSpace;
11947 int __pyx_v_nElements_global;
11948 int __pyx_v_nElementBoundaries_element;
11949 CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray = 0;
11950 CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray = 0;
11951 int __pyx_v_nDOF_test_element;
11952 int __pyx_v_nDOF_trial_element;
11953 PyArrayObject *__pyx_v_q_u = 0;
11954 CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u = 0;
11955 PyArrayObject *__pyx_v_q_grad_w = 0;
11956 PyArrayObject *__pyx_v_q_grad_v = 0;
11957 PyArrayObject *__pyx_v_q_detJ = 0;
11958 PyArrayObject *__pyx_v_q_m = 0;
11959 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm = 0;
11960 PyArrayObject *__pyx_v_q_mt = 0;
11961 PyArrayObject *__pyx_v_q_dmt = 0;
11962 PyArrayObject *__pyx_v_q_r = 0;
11963 PyArrayObject *__pyx_v_q_kr = 0;
11964 CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr = 0;
11965 PyArrayObject *__pyx_v_q_kr_up = 0;
11966 PyArrayObject *__pyx_v_q_flin = 0;
11967 PyArrayObject *__pyx_v_q_alin = 0;
11968 PyArrayObject *__pyx_v_elementJacobian = 0;
11969 int __pyx_lineno = 0;
11970 const char *__pyx_filename = NULL;
11971 int __pyx_clineno = 0;
11972 PyObject *__pyx_r = 0;
11973 __Pyx_RefNannyDeclarations
11974 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian (wrapper)", 0);
11976 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_gravity,&__pyx_n_s_rowptr,&__pyx_n_s_colind,&__pyx_n_s_nSpace,&__pyx_n_s_nElements_global,&__pyx_n_s_nElementBoundaries_element,&__pyx_n_s_elementNeighborsArray,&__pyx_n_s_elementBarycentersArray,&__pyx_n_s_nDOF_test_element,&__pyx_n_s_nDOF_trial_element,&__pyx_n_s_q_u,&__pyx_n_s_q_grad_u,&__pyx_n_s_q_grad_w,&__pyx_n_s_q_grad_v,&__pyx_n_s_q_detJ,&__pyx_n_s_q_m,&__pyx_n_s_q_dm,&__pyx_n_s_q_mt,&__pyx_n_s_q_dmt,&__pyx_n_s_q_r,&__pyx_n_s_q_kr,&__pyx_n_s_q_dkr,&__pyx_n_s_q_kr_up,&__pyx_n_s_q_flin,&__pyx_n_s_q_alin,&__pyx_n_s_elementJacobian,0};
11977 PyObject* values[26] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
11978 if (unlikely(__pyx_kwds)) {
11979 Py_ssize_t kw_args;
11980 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
11981 switch (pos_args) {
11982 case 26: values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
11983 case 25: values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
11984 case 24: values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
11985 case 23: values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
11986 case 22: values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
11987 case 21: values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
11988 case 20: values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
11989 case 19: values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
11990 case 18: values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
11991 case 17: values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
11992 case 16: values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
11993 case 15: values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
11994 case 14: values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
11995 case 13: values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
11996 case 12: values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
11997 case 11: values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
11998 case 10: values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
11999 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
12000 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12001 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12002 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12003 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12004 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12005 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12006 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12007 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12009 default:
goto __pyx_L5_argtuple_error;
12011 kw_args = PyDict_Size(__pyx_kwds);
12012 switch (pos_args) {
12014 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_gravity)) != 0)) kw_args--;
12015 else goto __pyx_L5_argtuple_error;
12017 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_rowptr)) != 0)) kw_args--;
12019 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12022 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_colind)) != 0)) kw_args--;
12024 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12027 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nSpace)) != 0)) kw_args--;
12029 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12032 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElements_global)) != 0)) kw_args--;
12034 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12037 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nElementBoundaries_element)) != 0)) kw_args--;
12039 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12042 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementNeighborsArray)) != 0)) kw_args--;
12044 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12047 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementBarycentersArray)) != 0)) kw_args--;
12049 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12052 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_test_element)) != 0)) kw_args--;
12054 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12057 if (likely((values[9] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_nDOF_trial_element)) != 0)) kw_args--;
12059 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 9); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12062 if (likely((values[10] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_u)) != 0)) kw_args--;
12064 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 10); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12067 if (likely((values[11] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_u)) != 0)) kw_args--;
12069 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 11); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12072 if (likely((values[12] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_w)) != 0)) kw_args--;
12074 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 12); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12077 if (likely((values[13] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_grad_v)) != 0)) kw_args--;
12079 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 13); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12082 if (likely((values[14] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_detJ)) != 0)) kw_args--;
12084 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 14); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12087 if (likely((values[15] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_m)) != 0)) kw_args--;
12089 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 15); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12092 if (likely((values[16] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dm)) != 0)) kw_args--;
12094 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 16); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12097 if (likely((values[17] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_mt)) != 0)) kw_args--;
12099 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 17); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12102 if (likely((values[18] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dmt)) != 0)) kw_args--;
12104 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 18); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12107 if (likely((values[19] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_r)) != 0)) kw_args--;
12109 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 19); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12112 if (likely((values[20] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr)) != 0)) kw_args--;
12114 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 20); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12117 if (likely((values[21] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_dkr)) != 0)) kw_args--;
12119 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 21); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12122 if (likely((values[22] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_kr_up)) != 0)) kw_args--;
12124 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 22); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12127 if (likely((values[23] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_flin)) != 0)) kw_args--;
12129 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 23); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12132 if (likely((values[24] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_q_alin)) != 0)) kw_args--;
12134 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 24); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12137 if (likely((values[25] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_elementJacobian)) != 0)) kw_args--;
12139 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, 25); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12142 if (unlikely(kw_args > 0)) {
12143 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"RE_NCP1_getElementJacobian") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12145 }
else if (PyTuple_GET_SIZE(__pyx_args) != 26) {
12146 goto __pyx_L5_argtuple_error;
12148 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12149 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12150 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
12151 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
12152 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
12153 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
12154 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
12155 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
12156 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
12157 values[9] = PyTuple_GET_ITEM(__pyx_args, 9);
12158 values[10] = PyTuple_GET_ITEM(__pyx_args, 10);
12159 values[11] = PyTuple_GET_ITEM(__pyx_args, 11);
12160 values[12] = PyTuple_GET_ITEM(__pyx_args, 12);
12161 values[13] = PyTuple_GET_ITEM(__pyx_args, 13);
12162 values[14] = PyTuple_GET_ITEM(__pyx_args, 14);
12163 values[15] = PyTuple_GET_ITEM(__pyx_args, 15);
12164 values[16] = PyTuple_GET_ITEM(__pyx_args, 16);
12165 values[17] = PyTuple_GET_ITEM(__pyx_args, 17);
12166 values[18] = PyTuple_GET_ITEM(__pyx_args, 18);
12167 values[19] = PyTuple_GET_ITEM(__pyx_args, 19);
12168 values[20] = PyTuple_GET_ITEM(__pyx_args, 20);
12169 values[21] = PyTuple_GET_ITEM(__pyx_args, 21);
12170 values[22] = PyTuple_GET_ITEM(__pyx_args, 22);
12171 values[23] = PyTuple_GET_ITEM(__pyx_args, 23);
12172 values[24] = PyTuple_GET_ITEM(__pyx_args, 24);
12173 values[25] = PyTuple_GET_ITEM(__pyx_args, 25);
12175 __pyx_v_gravity = ((PyArrayObject *)values[0]);
12176 __pyx_v_rowptr = ((PyArrayObject *)values[1]);
12177 __pyx_v_colind = ((PyArrayObject *)values[2]);
12178 __pyx_v_nSpace = __Pyx_PyInt_As_int(values[3]);
if (unlikely((__pyx_v_nSpace == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12179 __pyx_v_nElements_global = __Pyx_PyInt_As_int(values[4]);
if (unlikely((__pyx_v_nElements_global == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 579; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12180 __pyx_v_nElementBoundaries_element = __Pyx_PyInt_As_int(values[5]);
if (unlikely((__pyx_v_nElementBoundaries_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 580; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12181 __pyx_v_elementNeighborsArray = ((PyArrayObject *)values[6]);
12182 __pyx_v_elementBarycentersArray = ((PyArrayObject *)values[7]);
12183 __pyx_v_nDOF_test_element = __Pyx_PyInt_As_int(values[8]);
if (unlikely((__pyx_v_nDOF_test_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 584; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12184 __pyx_v_nDOF_trial_element = __Pyx_PyInt_As_int(values[9]);
if (unlikely((__pyx_v_nDOF_trial_element == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 585; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12185 __pyx_v_q_u = ((PyArrayObject *)values[10]);
12186 __pyx_v_q_grad_u = ((PyArrayObject *)values[11]);
12187 __pyx_v_q_grad_w = ((PyArrayObject *)values[12]);
12188 __pyx_v_q_grad_v = ((PyArrayObject *)values[13]);
12189 __pyx_v_q_detJ = ((PyArrayObject *)values[14]);
12190 __pyx_v_q_m = ((PyArrayObject *)values[15]);
12191 __pyx_v_q_dm = ((PyArrayObject *)values[16]);
12192 __pyx_v_q_mt = ((PyArrayObject *)values[17]);
12193 __pyx_v_q_dmt = ((PyArrayObject *)values[18]);
12194 __pyx_v_q_r = ((PyArrayObject *)values[19]);
12195 __pyx_v_q_kr = ((PyArrayObject *)values[20]);
12196 __pyx_v_q_dkr = ((PyArrayObject *)values[21]);
12197 __pyx_v_q_kr_up = ((PyArrayObject *)values[22]);
12198 __pyx_v_q_flin = ((PyArrayObject *)values[23]);
12199 __pyx_v_q_alin = ((PyArrayObject *)values[24]);
12200 __pyx_v_elementJacobian = ((PyArrayObject *)values[25]);
12202 goto __pyx_L4_argument_unpacking_done;
12203 __pyx_L5_argtuple_error:;
12204 __Pyx_RaiseArgtupleInvalid(
"RE_NCP1_getElementJacobian", 1, 26, 26, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
12206 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
12207 __Pyx_RefNannyFinishContext();
12209 __pyx_L4_argument_unpacking_done:;
12210 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_gravity), __pyx_ptype_5numpy_ndarray, 1,
"gravity", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12211 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_rowptr), __pyx_ptype_5numpy_ndarray, 1,
"rowptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 575; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12212 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colind), __pyx_ptype_5numpy_ndarray, 1,
"colind", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12213 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementNeighborsArray), __pyx_ptype_5numpy_ndarray, 1,
"elementNeighborsArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 581; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12214 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementBarycentersArray), __pyx_ptype_5numpy_ndarray, 1,
"elementBarycentersArray", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 582; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12215 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_u), __pyx_ptype_5numpy_ndarray, 1,
"q_u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 586; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12216 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_u), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_u", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 587; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12217 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_w), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 588; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12218 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_grad_v), __pyx_ptype_5numpy_ndarray, 1,
"q_grad_v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 589; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12219 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_detJ), __pyx_ptype_5numpy_ndarray, 1,
"q_detJ", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 591; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12220 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_m), __pyx_ptype_5numpy_ndarray, 1,
"q_m", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 592; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12221 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dm), __pyx_ptype_5numpy_ndarray, 1,
"q_dm", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 593; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12222 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_mt), __pyx_ptype_5numpy_ndarray, 1,
"q_mt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 594; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12223 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dmt), __pyx_ptype_5numpy_ndarray, 1,
"q_dmt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 595; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12224 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_r), __pyx_ptype_5numpy_ndarray, 1,
"q_r", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 596; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12225 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr), __pyx_ptype_5numpy_ndarray, 1,
"q_kr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 597; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12226 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_dkr), __pyx_ptype_5numpy_ndarray, 1,
"q_dkr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 598; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12227 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_kr_up), __pyx_ptype_5numpy_ndarray, 1,
"q_kr_up", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 599; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12228 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_flin), __pyx_ptype_5numpy_ndarray, 1,
"q_flin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12229 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_q_alin), __pyx_ptype_5numpy_ndarray, 1,
"q_alin", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12230 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_elementJacobian), __pyx_ptype_5numpy_ndarray, 1,
"elementJacobian", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12231 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(__pyx_self, __pyx_v_gravity, __pyx_v_rowptr, __pyx_v_colind, __pyx_v_nSpace, __pyx_v_nElements_global, __pyx_v_nElementBoundaries_element, __pyx_v_elementNeighborsArray, __pyx_v_elementBarycentersArray, __pyx_v_nDOF_test_element, __pyx_v_nDOF_trial_element, __pyx_v_q_u, __pyx_v_q_grad_u, __pyx_v_q_grad_w, __pyx_v_q_grad_v, __pyx_v_q_detJ, __pyx_v_q_m, __pyx_v_q_dm, __pyx_v_q_mt, __pyx_v_q_dmt, __pyx_v_q_r, __pyx_v_q_kr, __pyx_v_q_dkr, __pyx_v_q_kr_up, __pyx_v_q_flin, __pyx_v_q_alin, __pyx_v_elementJacobian);
12238 __Pyx_RefNannyFinishContext();
12242 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_34RE_NCP1_getElementJacobian(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyArrayObject *__pyx_v_gravity, PyArrayObject *__pyx_v_rowptr, PyArrayObject *__pyx_v_colind,
int __pyx_v_nSpace,
int __pyx_v_nElements_global,
int __pyx_v_nElementBoundaries_element, CYTHON_UNUSED PyArrayObject *__pyx_v_elementNeighborsArray, CYTHON_UNUSED PyArrayObject *__pyx_v_elementBarycentersArray,
int __pyx_v_nDOF_test_element,
int __pyx_v_nDOF_trial_element, PyArrayObject *__pyx_v_q_u, CYTHON_UNUSED PyArrayObject *__pyx_v_q_grad_u, PyArrayObject *__pyx_v_q_grad_w, PyArrayObject *__pyx_v_q_grad_v, PyArrayObject *__pyx_v_q_detJ, PyArrayObject *__pyx_v_q_m, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dm, PyArrayObject *__pyx_v_q_mt, PyArrayObject *__pyx_v_q_dmt, PyArrayObject *__pyx_v_q_r, PyArrayObject *__pyx_v_q_kr, CYTHON_UNUSED PyArrayObject *__pyx_v_q_dkr, PyArrayObject *__pyx_v_q_kr_up, PyArrayObject *__pyx_v_q_flin, PyArrayObject *__pyx_v_q_alin, PyArrayObject *__pyx_v_elementJacobian) {
12243 CYTHON_UNUSED
int __pyx_v_upwindFlag;
12244 CYTHON_UNUSED
int __pyx_v_picard;
12245 PyObject *__pyx_v_q = NULL;
12250 PyArrayObject *__pyx_v_a_up = 0;
12251 PyArrayObject *__pyx_v_f_up = 0;
12252 double __pyx_v_nAvgWeight;
12253 double __pyx_v_weight;
12254 double __pyx_v_volFactor;
12255 CYTHON_UNUSED
int __pyx_v_thisElementIsUpwind;
12256 double __pyx_v_volume;
12260 __Pyx_LocalBuf_ND __pyx_pybuffernd_a_up;
12261 __Pyx_Buffer __pyx_pybuffer_a_up;
12262 __Pyx_LocalBuf_ND __pyx_pybuffernd_colind;
12263 __Pyx_Buffer __pyx_pybuffer_colind;
12264 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementBarycentersArray;
12265 __Pyx_Buffer __pyx_pybuffer_elementBarycentersArray;
12266 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementJacobian;
12267 __Pyx_Buffer __pyx_pybuffer_elementJacobian;
12268 __Pyx_LocalBuf_ND __pyx_pybuffernd_elementNeighborsArray;
12269 __Pyx_Buffer __pyx_pybuffer_elementNeighborsArray;
12270 __Pyx_LocalBuf_ND __pyx_pybuffernd_f_up;
12271 __Pyx_Buffer __pyx_pybuffer_f_up;
12272 __Pyx_LocalBuf_ND __pyx_pybuffernd_gravity;
12273 __Pyx_Buffer __pyx_pybuffer_gravity;
12274 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_alin;
12275 __Pyx_Buffer __pyx_pybuffer_q_alin;
12276 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_detJ;
12277 __Pyx_Buffer __pyx_pybuffer_q_detJ;
12278 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dkr;
12279 __Pyx_Buffer __pyx_pybuffer_q_dkr;
12280 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dm;
12281 __Pyx_Buffer __pyx_pybuffer_q_dm;
12282 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_dmt;
12283 __Pyx_Buffer __pyx_pybuffer_q_dmt;
12284 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_flin;
12285 __Pyx_Buffer __pyx_pybuffer_q_flin;
12286 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_u;
12287 __Pyx_Buffer __pyx_pybuffer_q_grad_u;
12288 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_v;
12289 __Pyx_Buffer __pyx_pybuffer_q_grad_v;
12290 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_grad_w;
12291 __Pyx_Buffer __pyx_pybuffer_q_grad_w;
12292 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr;
12293 __Pyx_Buffer __pyx_pybuffer_q_kr;
12294 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_kr_up;
12295 __Pyx_Buffer __pyx_pybuffer_q_kr_up;
12296 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_m;
12297 __Pyx_Buffer __pyx_pybuffer_q_m;
12298 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_mt;
12299 __Pyx_Buffer __pyx_pybuffer_q_mt;
12300 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_r;
12301 __Pyx_Buffer __pyx_pybuffer_q_r;
12302 __Pyx_LocalBuf_ND __pyx_pybuffernd_q_u;
12303 __Pyx_Buffer __pyx_pybuffer_q_u;
12304 __Pyx_LocalBuf_ND __pyx_pybuffernd_rowptr;
12305 __Pyx_Buffer __pyx_pybuffer_rowptr;
12306 PyObject *__pyx_r = NULL;
12307 __Pyx_RefNannyDeclarations
12308 PyObject *__pyx_t_1 = NULL;
12309 PyObject *__pyx_t_2 = NULL;
12310 Py_ssize_t __pyx_t_3;
12311 PyObject *__pyx_t_4 = NULL;
12312 PyObject *__pyx_t_5 = NULL;
12314 Py_ssize_t __pyx_t_7;
12316 PyObject *__pyx_t_9 = NULL;
12317 PyArrayObject *__pyx_t_10 = NULL;
12318 PyArrayObject *__pyx_t_11 = NULL;
12321 Py_ssize_t __pyx_t_14;
12322 Py_ssize_t __pyx_t_15;
12325 Py_ssize_t __pyx_t_18;
12326 Py_ssize_t __pyx_t_19;
12328 Py_ssize_t __pyx_t_21;
12329 Py_ssize_t __pyx_t_22;
12330 Py_ssize_t __pyx_t_23;
12334 Py_ssize_t __pyx_t_27;
12335 Py_ssize_t __pyx_t_28;
12336 Py_ssize_t __pyx_t_29;
12338 Py_ssize_t __pyx_t_31;
12339 Py_ssize_t __pyx_t_32;
12340 Py_ssize_t __pyx_t_33;
12341 Py_ssize_t __pyx_t_34;
12342 Py_ssize_t __pyx_t_35;
12343 Py_ssize_t __pyx_t_36;
12344 Py_ssize_t __pyx_t_37;
12345 Py_ssize_t __pyx_t_38;
12346 Py_ssize_t __pyx_t_39;
12348 Py_ssize_t __pyx_t_41;
12350 __pyx_t_28subsurfaceTransportFunctions_ITYPE_t __pyx_t_43;
12351 Py_ssize_t __pyx_t_44;
12352 Py_ssize_t __pyx_t_45;
12354 Py_ssize_t __pyx_t_47;
12355 Py_ssize_t __pyx_t_48;
12356 Py_ssize_t __pyx_t_49;
12357 Py_ssize_t __pyx_t_50;
12358 Py_ssize_t __pyx_t_51;
12359 Py_ssize_t __pyx_t_52;
12360 Py_ssize_t __pyx_t_53;
12361 Py_ssize_t __pyx_t_54;
12362 Py_ssize_t __pyx_t_55;
12363 Py_ssize_t __pyx_t_56;
12364 Py_ssize_t __pyx_t_57;
12365 Py_ssize_t __pyx_t_58;
12366 int __pyx_lineno = 0;
12367 const char *__pyx_filename = NULL;
12368 int __pyx_clineno = 0;
12369 __Pyx_RefNannySetupContext(
"RE_NCP1_getElementJacobian", 0);
12370 __pyx_pybuffer_a_up.pybuffer.buf = NULL;
12371 __pyx_pybuffer_a_up.refcount = 0;
12372 __pyx_pybuffernd_a_up.data = NULL;
12373 __pyx_pybuffernd_a_up.rcbuffer = &__pyx_pybuffer_a_up;
12374 __pyx_pybuffer_f_up.pybuffer.buf = NULL;
12375 __pyx_pybuffer_f_up.refcount = 0;
12376 __pyx_pybuffernd_f_up.data = NULL;
12377 __pyx_pybuffernd_f_up.rcbuffer = &__pyx_pybuffer_f_up;
12378 __pyx_pybuffer_gravity.pybuffer.buf = NULL;
12379 __pyx_pybuffer_gravity.refcount = 0;
12380 __pyx_pybuffernd_gravity.data = NULL;
12381 __pyx_pybuffernd_gravity.rcbuffer = &__pyx_pybuffer_gravity;
12382 __pyx_pybuffer_rowptr.pybuffer.buf = NULL;
12383 __pyx_pybuffer_rowptr.refcount = 0;
12384 __pyx_pybuffernd_rowptr.data = NULL;
12385 __pyx_pybuffernd_rowptr.rcbuffer = &__pyx_pybuffer_rowptr;
12386 __pyx_pybuffer_colind.pybuffer.buf = NULL;
12387 __pyx_pybuffer_colind.refcount = 0;
12388 __pyx_pybuffernd_colind.data = NULL;
12389 __pyx_pybuffernd_colind.rcbuffer = &__pyx_pybuffer_colind;
12390 __pyx_pybuffer_elementNeighborsArray.pybuffer.buf = NULL;
12391 __pyx_pybuffer_elementNeighborsArray.refcount = 0;
12392 __pyx_pybuffernd_elementNeighborsArray.data = NULL;
12393 __pyx_pybuffernd_elementNeighborsArray.rcbuffer = &__pyx_pybuffer_elementNeighborsArray;
12394 __pyx_pybuffer_elementBarycentersArray.pybuffer.buf = NULL;
12395 __pyx_pybuffer_elementBarycentersArray.refcount = 0;
12396 __pyx_pybuffernd_elementBarycentersArray.data = NULL;
12397 __pyx_pybuffernd_elementBarycentersArray.rcbuffer = &__pyx_pybuffer_elementBarycentersArray;
12398 __pyx_pybuffer_q_u.pybuffer.buf = NULL;
12399 __pyx_pybuffer_q_u.refcount = 0;
12400 __pyx_pybuffernd_q_u.data = NULL;
12401 __pyx_pybuffernd_q_u.rcbuffer = &__pyx_pybuffer_q_u;
12402 __pyx_pybuffer_q_grad_u.pybuffer.buf = NULL;
12403 __pyx_pybuffer_q_grad_u.refcount = 0;
12404 __pyx_pybuffernd_q_grad_u.data = NULL;
12405 __pyx_pybuffernd_q_grad_u.rcbuffer = &__pyx_pybuffer_q_grad_u;
12406 __pyx_pybuffer_q_grad_w.pybuffer.buf = NULL;
12407 __pyx_pybuffer_q_grad_w.refcount = 0;
12408 __pyx_pybuffernd_q_grad_w.data = NULL;
12409 __pyx_pybuffernd_q_grad_w.rcbuffer = &__pyx_pybuffer_q_grad_w;
12410 __pyx_pybuffer_q_grad_v.pybuffer.buf = NULL;
12411 __pyx_pybuffer_q_grad_v.refcount = 0;
12412 __pyx_pybuffernd_q_grad_v.data = NULL;
12413 __pyx_pybuffernd_q_grad_v.rcbuffer = &__pyx_pybuffer_q_grad_v;
12414 __pyx_pybuffer_q_detJ.pybuffer.buf = NULL;
12415 __pyx_pybuffer_q_detJ.refcount = 0;
12416 __pyx_pybuffernd_q_detJ.data = NULL;
12417 __pyx_pybuffernd_q_detJ.rcbuffer = &__pyx_pybuffer_q_detJ;
12418 __pyx_pybuffer_q_m.pybuffer.buf = NULL;
12419 __pyx_pybuffer_q_m.refcount = 0;
12420 __pyx_pybuffernd_q_m.data = NULL;
12421 __pyx_pybuffernd_q_m.rcbuffer = &__pyx_pybuffer_q_m;
12422 __pyx_pybuffer_q_dm.pybuffer.buf = NULL;
12423 __pyx_pybuffer_q_dm.refcount = 0;
12424 __pyx_pybuffernd_q_dm.data = NULL;
12425 __pyx_pybuffernd_q_dm.rcbuffer = &__pyx_pybuffer_q_dm;
12426 __pyx_pybuffer_q_mt.pybuffer.buf = NULL;
12427 __pyx_pybuffer_q_mt.refcount = 0;
12428 __pyx_pybuffernd_q_mt.data = NULL;
12429 __pyx_pybuffernd_q_mt.rcbuffer = &__pyx_pybuffer_q_mt;
12430 __pyx_pybuffer_q_dmt.pybuffer.buf = NULL;
12431 __pyx_pybuffer_q_dmt.refcount = 0;
12432 __pyx_pybuffernd_q_dmt.data = NULL;
12433 __pyx_pybuffernd_q_dmt.rcbuffer = &__pyx_pybuffer_q_dmt;
12434 __pyx_pybuffer_q_r.pybuffer.buf = NULL;
12435 __pyx_pybuffer_q_r.refcount = 0;
12436 __pyx_pybuffernd_q_r.data = NULL;
12437 __pyx_pybuffernd_q_r.rcbuffer = &__pyx_pybuffer_q_r;
12438 __pyx_pybuffer_q_kr.pybuffer.buf = NULL;
12439 __pyx_pybuffer_q_kr.refcount = 0;
12440 __pyx_pybuffernd_q_kr.data = NULL;
12441 __pyx_pybuffernd_q_kr.rcbuffer = &__pyx_pybuffer_q_kr;
12442 __pyx_pybuffer_q_dkr.pybuffer.buf = NULL;
12443 __pyx_pybuffer_q_dkr.refcount = 0;
12444 __pyx_pybuffernd_q_dkr.data = NULL;
12445 __pyx_pybuffernd_q_dkr.rcbuffer = &__pyx_pybuffer_q_dkr;
12446 __pyx_pybuffer_q_kr_up.pybuffer.buf = NULL;
12447 __pyx_pybuffer_q_kr_up.refcount = 0;
12448 __pyx_pybuffernd_q_kr_up.data = NULL;
12449 __pyx_pybuffernd_q_kr_up.rcbuffer = &__pyx_pybuffer_q_kr_up;
12450 __pyx_pybuffer_q_flin.pybuffer.buf = NULL;
12451 __pyx_pybuffer_q_flin.refcount = 0;
12452 __pyx_pybuffernd_q_flin.data = NULL;
12453 __pyx_pybuffernd_q_flin.rcbuffer = &__pyx_pybuffer_q_flin;
12454 __pyx_pybuffer_q_alin.pybuffer.buf = NULL;
12455 __pyx_pybuffer_q_alin.refcount = 0;
12456 __pyx_pybuffernd_q_alin.data = NULL;
12457 __pyx_pybuffernd_q_alin.rcbuffer = &__pyx_pybuffer_q_alin;
12458 __pyx_pybuffer_elementJacobian.pybuffer.buf = NULL;
12459 __pyx_pybuffer_elementJacobian.refcount = 0;
12460 __pyx_pybuffernd_elementJacobian.data = NULL;
12461 __pyx_pybuffernd_elementJacobian.rcbuffer = &__pyx_pybuffer_elementJacobian;
12463 __Pyx_BufFmt_StackElem __pyx_stack[1];
12464 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer, (PyObject*)__pyx_v_gravity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12466 __pyx_pybuffernd_gravity.diminfo[0].strides = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_gravity.diminfo[0].shape = __pyx_pybuffernd_gravity.rcbuffer->pybuffer.shape[0];
12468 __Pyx_BufFmt_StackElem __pyx_stack[1];
12469 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer, (PyObject*)__pyx_v_rowptr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12471 __pyx_pybuffernd_rowptr.diminfo[0].strides = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_rowptr.diminfo[0].shape = __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.shape[0];
12473 __Pyx_BufFmt_StackElem __pyx_stack[1];
12474 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colind.rcbuffer->pybuffer, (PyObject*)__pyx_v_colind, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12476 __pyx_pybuffernd_colind.diminfo[0].strides = __pyx_pybuffernd_colind.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colind.diminfo[0].shape = __pyx_pybuffernd_colind.rcbuffer->pybuffer.shape[0];
12478 __Pyx_BufFmt_StackElem __pyx_stack[1];
12479 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementNeighborsArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12481 __pyx_pybuffernd_elementNeighborsArray.diminfo[0].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[0].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].strides = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementNeighborsArray.diminfo[1].shape = __pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer.shape[1];
12483 __Pyx_BufFmt_StackElem __pyx_stack[1];
12484 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementBarycentersArray, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12486 __pyx_pybuffernd_elementBarycentersArray.diminfo[0].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[0].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].strides = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementBarycentersArray.diminfo[1].shape = __pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer.shape[1];
12488 __Pyx_BufFmt_StackElem __pyx_stack[1];
12489 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12491 __pyx_pybuffernd_q_u.diminfo[0].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_u.diminfo[0].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_u.diminfo[1].strides = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_u.diminfo[1].shape = __pyx_pybuffernd_q_u.rcbuffer->pybuffer.shape[1];
12493 __Pyx_BufFmt_StackElem __pyx_stack[1];
12494 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_u, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12496 __pyx_pybuffernd_q_grad_u.diminfo[0].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_u.diminfo[0].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_u.diminfo[1].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_u.diminfo[1].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_u.diminfo[2].strides = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_u.diminfo[2].shape = __pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer.shape[2];
12498 __Pyx_BufFmt_StackElem __pyx_stack[1];
12499 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12501 __pyx_pybuffernd_q_grad_w.diminfo[0].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_w.diminfo[0].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_w.diminfo[1].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_w.diminfo[1].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_w.diminfo[2].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_w.diminfo[2].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_w.diminfo[3].strides = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_w.diminfo[3].shape = __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.shape[3];
12503 __Pyx_BufFmt_StackElem __pyx_stack[1];
12504 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_grad_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12506 __pyx_pybuffernd_q_grad_v.diminfo[0].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_grad_v.diminfo[0].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_grad_v.diminfo[1].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_grad_v.diminfo[1].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_grad_v.diminfo[2].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_grad_v.diminfo[2].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_q_grad_v.diminfo[3].strides = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_q_grad_v.diminfo[3].shape = __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.shape[3];
12508 __Pyx_BufFmt_StackElem __pyx_stack[1];
12509 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_detJ, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12511 __pyx_pybuffernd_q_detJ.diminfo[0].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_detJ.diminfo[0].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_detJ.diminfo[1].strides = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_detJ.diminfo[1].shape = __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.shape[1];
12513 __Pyx_BufFmt_StackElem __pyx_stack[1];
12514 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_m, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12516 __pyx_pybuffernd_q_m.diminfo[0].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_m.diminfo[0].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_m.diminfo[1].strides = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_m.diminfo[1].shape = __pyx_pybuffernd_q_m.rcbuffer->pybuffer.shape[1];
12518 __Pyx_BufFmt_StackElem __pyx_stack[1];
12519 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12521 __pyx_pybuffernd_q_dm.diminfo[0].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dm.diminfo[0].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dm.diminfo[1].strides = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dm.diminfo[1].shape = __pyx_pybuffernd_q_dm.rcbuffer->pybuffer.shape[1];
12523 __Pyx_BufFmt_StackElem __pyx_stack[1];
12524 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12526 __pyx_pybuffernd_q_mt.diminfo[0].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_mt.diminfo[0].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_mt.diminfo[1].strides = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_mt.diminfo[1].shape = __pyx_pybuffernd_q_mt.rcbuffer->pybuffer.shape[1];
12528 __Pyx_BufFmt_StackElem __pyx_stack[1];
12529 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12531 __pyx_pybuffernd_q_dmt.diminfo[0].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dmt.diminfo[0].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dmt.diminfo[1].strides = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dmt.diminfo[1].shape = __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.shape[1];
12533 __Pyx_BufFmt_StackElem __pyx_stack[1];
12534 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_r, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12536 __pyx_pybuffernd_q_r.diminfo[0].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_r.diminfo[0].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_r.diminfo[1].strides = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_r.diminfo[1].shape = __pyx_pybuffernd_q_r.rcbuffer->pybuffer.shape[1];
12538 __Pyx_BufFmt_StackElem __pyx_stack[1];
12539 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12541 __pyx_pybuffernd_q_kr.diminfo[0].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr.diminfo[0].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr.diminfo[1].strides = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr.diminfo[1].shape = __pyx_pybuffernd_q_kr.rcbuffer->pybuffer.shape[1];
12543 __Pyx_BufFmt_StackElem __pyx_stack[1];
12544 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_dkr, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12546 __pyx_pybuffernd_q_dkr.diminfo[0].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_dkr.diminfo[0].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_dkr.diminfo[1].strides = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_dkr.diminfo[1].shape = __pyx_pybuffernd_q_dkr.rcbuffer->pybuffer.shape[1];
12548 __Pyx_BufFmt_StackElem __pyx_stack[1];
12549 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_kr_up, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12551 __pyx_pybuffernd_q_kr_up.diminfo[0].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_kr_up.diminfo[0].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_kr_up.diminfo[1].strides = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_kr_up.diminfo[1].shape = __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.shape[1];
12553 __Pyx_BufFmt_StackElem __pyx_stack[1];
12554 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_flin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12556 __pyx_pybuffernd_q_flin.diminfo[0].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_flin.diminfo[0].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_flin.diminfo[1].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_flin.diminfo[1].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_flin.diminfo[2].strides = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_flin.diminfo[2].shape = __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.shape[2];
12558 __Pyx_BufFmt_StackElem __pyx_stack[1];
12559 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer, (PyObject*)__pyx_v_q_alin, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12561 __pyx_pybuffernd_q_alin.diminfo[0].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_q_alin.diminfo[0].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_q_alin.diminfo[1].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_q_alin.diminfo[1].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_q_alin.diminfo[2].strides = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_q_alin.diminfo[2].shape = __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.shape[2];
12563 __Pyx_BufFmt_StackElem __pyx_stack[1];
12564 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer, (PyObject*)__pyx_v_elementJacobian, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12566 __pyx_pybuffernd_elementJacobian.diminfo[0].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_elementJacobian.diminfo[0].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_elementJacobian.diminfo[1].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_elementJacobian.diminfo[1].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_elementJacobian.diminfo[2].strides = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_elementJacobian.diminfo[2].shape = __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.shape[2];
12575 __pyx_v_upwindFlag = 1;
12584 __pyx_v_picard = 1;
12593 __pyx_t_1 = PyTuple_New(5);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12594 __Pyx_GOTREF(__pyx_t_1);
12595 __Pyx_INCREF(((PyObject *)__pyx_v_q_u));
12596 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_u));
12597 PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_q_u));
12598 __Pyx_INCREF(((PyObject *)__pyx_v_q_m));
12599 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_m));
12600 PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)__pyx_v_q_m));
12601 __Pyx_INCREF(((PyObject *)__pyx_v_q_mt));
12602 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_mt));
12603 PyTuple_SET_ITEM(__pyx_t_1, 2, ((PyObject *)__pyx_v_q_mt));
12604 __Pyx_INCREF(((PyObject *)__pyx_v_q_r));
12605 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_r));
12606 PyTuple_SET_ITEM(__pyx_t_1, 3, ((PyObject *)__pyx_v_q_r));
12607 __Pyx_INCREF(((PyObject *)__pyx_v_q_kr));
12608 __Pyx_GIVEREF(((PyObject *)__pyx_v_q_kr));
12609 PyTuple_SET_ITEM(__pyx_t_1, 4, ((PyObject *)__pyx_v_q_kr));
12610 __pyx_t_2 = __pyx_t_1; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
12611 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12613 if (__pyx_t_3 >= 5)
break;
12614 #if CYTHON_COMPILING_IN_CPYTHON
12615 __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12617 __pyx_t_1 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++;
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 623; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12618 __Pyx_GOTREF(__pyx_t_1);
12620 __Pyx_XDECREF_SET(__pyx_v_q, __pyx_t_1);
12630 #ifndef CYTHON_WITHOUT_ASSERTIONS
12631 if (unlikely(!Py_OptimizeFlag)) {
12632 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_q, __pyx_n_s_shape);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12633 __Pyx_GOTREF(__pyx_t_1);
12634 __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_1, 1,
long, 1, __Pyx_PyInt_From_long, 0, 0, 1);
if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
12635 __Pyx_GOTREF(__pyx_t_4);
12636 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12637 __pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_nSpace + 1));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12638 __Pyx_GOTREF(__pyx_t_1);
12639 __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_5);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12640 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12641 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12642 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12643 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12644 if (unlikely(!__pyx_t_6)) {
12645 PyErr_SetNone(PyExc_AssertionError);
12646 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 624; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12659 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
12668 #ifndef CYTHON_WITHOUT_ASSERTIONS
12669 if (unlikely(!Py_OptimizeFlag)) {
12670 if (unlikely(!((__pyx_v_nDOF_test_element == (__pyx_v_nSpace + 1)) != 0))) {
12671 PyErr_SetNone(PyExc_AssertionError);
12672 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 625; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12684 __pyx_t_7 = __pyx_v_nSpace;
12686 if (__pyx_t_7 < 0) {
12687 __pyx_t_7 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
12688 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
12689 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_8 = 0;
12690 if (unlikely(__pyx_t_8 != -1)) {
12691 __Pyx_RaiseBufferIndexError(__pyx_t_8);
12692 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 626; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12694 __pyx_v_nnz = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_rowptr.diminfo[0].strides));
12703 __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12704 __Pyx_GOTREF(__pyx_t_5);
12705 __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12706 __Pyx_GOTREF(__pyx_t_1);
12707 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12708 __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_nnz);
if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12709 __Pyx_GOTREF(__pyx_t_5);
12712 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_1))) {
12713 __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
12714 if (likely(__pyx_t_4)) {
12715 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_1);
12716 __Pyx_INCREF(__pyx_t_4);
12717 __Pyx_INCREF(
function);
12718 __Pyx_DECREF_SET(__pyx_t_1,
function);
12722 __pyx_t_9 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12723 __Pyx_GOTREF(__pyx_t_9);
12725 __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_4); __pyx_t_4 = NULL;
12727 __Pyx_GIVEREF(__pyx_t_5);
12728 PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_3, __pyx_t_5);
12729 __Pyx_INCREF(__pyx_n_s_d);
12730 __Pyx_GIVEREF(__pyx_n_s_d);
12731 PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_3, __pyx_n_s_d);
12733 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_9, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12734 __Pyx_GOTREF(__pyx_t_2);
12735 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12736 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12737 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12738 __pyx_t_10 = ((PyArrayObject *)__pyx_t_2);
12740 __Pyx_BufFmt_StackElem __pyx_stack[1];
12741 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_10, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12742 __pyx_v_a_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf = NULL;
12743 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 630; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12744 }
else {__pyx_pybuffernd_a_up.diminfo[0].strides = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_a_up.diminfo[0].shape = __pyx_pybuffernd_a_up.rcbuffer->pybuffer.shape[0];
12748 __pyx_v_a_up = ((PyArrayObject *)__pyx_t_2);
12758 __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12759 __Pyx_GOTREF(__pyx_t_1);
12760 __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros);
if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12761 __Pyx_GOTREF(__pyx_t_9);
12762 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12763 __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_nSpace);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12764 __Pyx_GOTREF(__pyx_t_1);
12767 if (CYTHON_COMPILING_IN_CPYTHON && unlikely(PyMethod_Check(__pyx_t_9))) {
12768 __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_9);
12769 if (likely(__pyx_t_5)) {
12770 PyObject*
function = PyMethod_GET_FUNCTION(__pyx_t_9);
12771 __Pyx_INCREF(__pyx_t_5);
12772 __Pyx_INCREF(
function);
12773 __Pyx_DECREF_SET(__pyx_t_9,
function);
12777 __pyx_t_4 = PyTuple_New(2+__pyx_t_3);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12778 __Pyx_GOTREF(__pyx_t_4);
12780 __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
12782 __Pyx_GIVEREF(__pyx_t_1);
12783 PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_3, __pyx_t_1);
12784 __Pyx_INCREF(__pyx_n_s_d);
12785 __Pyx_GIVEREF(__pyx_n_s_d);
12786 PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_3, __pyx_n_s_d);
12788 __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12789 __Pyx_GOTREF(__pyx_t_2);
12790 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12791 __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12792 if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12793 __pyx_t_11 = ((PyArrayObject *)__pyx_t_2);
12795 __Pyx_BufFmt_StackElem __pyx_stack[1];
12796 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer, (PyObject*)__pyx_t_11, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {
12797 __pyx_v_f_up = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf = NULL;
12798 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 631; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12799 }
else {__pyx_pybuffernd_f_up.diminfo[0].strides = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_f_up.diminfo[0].shape = __pyx_pybuffernd_f_up.rcbuffer->pybuffer.shape[0];
12803 __pyx_v_f_up = ((PyArrayObject *)__pyx_t_2);
12813 __pyx_t_12 = (__pyx_v_nSpace + 1.);
12814 if (unlikely(__pyx_t_12 == 0)) {
12815 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
12816 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12818 __pyx_v_nAvgWeight = (1.0 / __pyx_t_12);
12827 __pyx_v_weight = 1.0;
12828 __pyx_v_volFactor = 1.0;
12837 __pyx_v_thisElementIsUpwind = 1;
12846 __pyx_t_6 = ((__pyx_v_nSpace == 2) != 0);
12856 __pyx_v_volFactor = 0.5;
12874 __pyx_t_6 = ((__pyx_v_nSpace == 3) != 0);
12884 __pyx_v_volFactor = (1.0 / 6.0);
12902 __pyx_t_8 = __pyx_v_nElements_global;
12903 for (__pyx_t_13 = 0; __pyx_t_13 < __pyx_t_8; __pyx_t_13+=1) {
12904 __pyx_v_eN = __pyx_t_13;
12913 __pyx_t_14 = __pyx_v_eN;
12916 if (__pyx_t_14 < 0) {
12917 __pyx_t_14 += __pyx_pybuffernd_q_detJ.diminfo[0].shape;
12918 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 0;
12919 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_q_detJ.diminfo[0].shape)) __pyx_t_16 = 0;
12920 if (__pyx_t_15 < 0) {
12921 __pyx_t_15 += __pyx_pybuffernd_q_detJ.diminfo[1].shape;
12922 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 1;
12923 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_q_detJ.diminfo[1].shape)) __pyx_t_16 = 1;
12924 if (unlikely(__pyx_t_16 != -1)) {
12925 __Pyx_RaiseBufferIndexError(__pyx_t_16);
12926 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 642; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12928 __pyx_v_volume = (__pyx_v_volFactor * fabs((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_detJ.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_q_detJ.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_q_detJ.diminfo[1].strides))));
12937 __pyx_v_weight = (__pyx_v_nAvgWeight * __pyx_v_volume);
12946 __pyx_t_16 = __pyx_v_nDOF_test_element;
12947 for (__pyx_t_17 = 0; __pyx_t_17 < __pyx_t_16; __pyx_t_17+=1) {
12948 __pyx_v_i = __pyx_t_17;
12957 __pyx_t_18 = __pyx_v_eN;
12958 __pyx_t_19 = __pyx_v_i;
12960 if (__pyx_t_18 < 0) {
12961 __pyx_t_18 += __pyx_pybuffernd_q_dmt.diminfo[0].shape;
12962 if (unlikely(__pyx_t_18 < 0)) __pyx_t_20 = 0;
12963 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_q_dmt.diminfo[0].shape)) __pyx_t_20 = 0;
12964 if (__pyx_t_19 < 0) {
12965 __pyx_t_19 += __pyx_pybuffernd_q_dmt.diminfo[1].shape;
12966 if (unlikely(__pyx_t_19 < 0)) __pyx_t_20 = 1;
12967 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_q_dmt.diminfo[1].shape)) __pyx_t_20 = 1;
12968 if (unlikely(__pyx_t_20 != -1)) {
12969 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12970 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12972 __pyx_t_21 = __pyx_v_eN;
12973 __pyx_t_22 = __pyx_v_i;
12974 __pyx_t_23 = __pyx_v_i;
12976 if (__pyx_t_21 < 0) {
12977 __pyx_t_21 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
12978 if (unlikely(__pyx_t_21 < 0)) __pyx_t_20 = 0;
12979 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_20 = 0;
12980 if (__pyx_t_22 < 0) {
12981 __pyx_t_22 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
12982 if (unlikely(__pyx_t_22 < 0)) __pyx_t_20 = 1;
12983 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_20 = 1;
12984 if (__pyx_t_23 < 0) {
12985 __pyx_t_23 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
12986 if (unlikely(__pyx_t_23 < 0)) __pyx_t_20 = 2;
12987 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_20 = 2;
12988 if (unlikely(__pyx_t_20 != -1)) {
12989 __Pyx_RaiseBufferIndexError(__pyx_t_20);
12990 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 650; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
12992 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (__pyx_v_weight * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_dmt.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_q_dmt.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_q_dmt.diminfo[1].strides)));
13001 __pyx_t_20 = __pyx_v_nElementBoundaries_element;
13002 for (__pyx_t_24 = 0; __pyx_t_24 < __pyx_t_20; __pyx_t_24+=1) {
13003 __pyx_v_ebN = __pyx_t_24;
13012 __pyx_t_25 = __pyx_v_nnz;
13013 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13014 __pyx_v_ii = __pyx_t_26;
13023 __pyx_t_27 = __pyx_v_eN;
13024 __pyx_t_28 = __pyx_v_ebN;
13025 __pyx_t_29 = __pyx_v_ii;
13027 if (__pyx_t_27 < 0) {
13028 __pyx_t_27 += __pyx_pybuffernd_q_alin.diminfo[0].shape;
13029 if (unlikely(__pyx_t_27 < 0)) __pyx_t_30 = 0;
13030 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_q_alin.diminfo[0].shape)) __pyx_t_30 = 0;
13031 if (__pyx_t_28 < 0) {
13032 __pyx_t_28 += __pyx_pybuffernd_q_alin.diminfo[1].shape;
13033 if (unlikely(__pyx_t_28 < 0)) __pyx_t_30 = 1;
13034 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_q_alin.diminfo[1].shape)) __pyx_t_30 = 1;
13035 if (__pyx_t_29 < 0) {
13036 __pyx_t_29 += __pyx_pybuffernd_q_alin.diminfo[2].shape;
13037 if (unlikely(__pyx_t_29 < 0)) __pyx_t_30 = 2;
13038 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_q_alin.diminfo[2].shape)) __pyx_t_30 = 2;
13039 if (unlikely(__pyx_t_30 != -1)) {
13040 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13041 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13043 __pyx_t_31 = __pyx_v_eN;
13044 __pyx_t_32 = __pyx_v_ebN;
13046 if (__pyx_t_31 < 0) {
13047 __pyx_t_31 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
13048 if (unlikely(__pyx_t_31 < 0)) __pyx_t_30 = 0;
13049 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_30 = 0;
13050 if (__pyx_t_32 < 0) {
13051 __pyx_t_32 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
13052 if (unlikely(__pyx_t_32 < 0)) __pyx_t_30 = 1;
13053 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_30 = 1;
13054 if (unlikely(__pyx_t_30 != -1)) {
13055 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13056 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13058 __pyx_t_33 = __pyx_v_ii;
13060 if (__pyx_t_33 < 0) {
13061 __pyx_t_33 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13062 if (unlikely(__pyx_t_33 < 0)) __pyx_t_30 = 0;
13063 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_30 = 0;
13064 if (unlikely(__pyx_t_30 != -1)) {
13065 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13066 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 656; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13068 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_33, __pyx_pybuffernd_a_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_alin.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_q_alin.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_q_alin.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_q_alin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
13078 __pyx_t_25 = __pyx_v_nSpace;
13079 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13080 __pyx_v_I = __pyx_t_26;
13089 __pyx_t_34 = __pyx_v_eN;
13090 __pyx_t_35 = __pyx_v_ebN;
13091 __pyx_t_36 = __pyx_v_I;
13093 if (__pyx_t_34 < 0) {
13094 __pyx_t_34 += __pyx_pybuffernd_q_flin.diminfo[0].shape;
13095 if (unlikely(__pyx_t_34 < 0)) __pyx_t_30 = 0;
13096 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_q_flin.diminfo[0].shape)) __pyx_t_30 = 0;
13097 if (__pyx_t_35 < 0) {
13098 __pyx_t_35 += __pyx_pybuffernd_q_flin.diminfo[1].shape;
13099 if (unlikely(__pyx_t_35 < 0)) __pyx_t_30 = 1;
13100 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_q_flin.diminfo[1].shape)) __pyx_t_30 = 1;
13101 if (__pyx_t_36 < 0) {
13102 __pyx_t_36 += __pyx_pybuffernd_q_flin.diminfo[2].shape;
13103 if (unlikely(__pyx_t_36 < 0)) __pyx_t_30 = 2;
13104 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_q_flin.diminfo[2].shape)) __pyx_t_30 = 2;
13105 if (unlikely(__pyx_t_30 != -1)) {
13106 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13107 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13109 __pyx_t_37 = __pyx_v_eN;
13110 __pyx_t_38 = __pyx_v_ebN;
13112 if (__pyx_t_37 < 0) {
13113 __pyx_t_37 += __pyx_pybuffernd_q_kr_up.diminfo[0].shape;
13114 if (unlikely(__pyx_t_37 < 0)) __pyx_t_30 = 0;
13115 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_q_kr_up.diminfo[0].shape)) __pyx_t_30 = 0;
13116 if (__pyx_t_38 < 0) {
13117 __pyx_t_38 += __pyx_pybuffernd_q_kr_up.diminfo[1].shape;
13118 if (unlikely(__pyx_t_38 < 0)) __pyx_t_30 = 1;
13119 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_q_kr_up.diminfo[1].shape)) __pyx_t_30 = 1;
13120 if (unlikely(__pyx_t_30 != -1)) {
13121 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13122 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13124 __pyx_t_39 = __pyx_v_I;
13126 if (__pyx_t_39 < 0) {
13127 __pyx_t_39 += __pyx_pybuffernd_f_up.diminfo[0].shape;
13128 if (unlikely(__pyx_t_39 < 0)) __pyx_t_30 = 0;
13129 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_f_up.diminfo[0].shape)) __pyx_t_30 = 0;
13130 if (unlikely(__pyx_t_30 != -1)) {
13131 __Pyx_RaiseBufferIndexError(__pyx_t_30);
13132 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 658; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13134 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_f_up.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_f_up.diminfo[0].strides) = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_flin.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_q_flin.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_q_flin.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_q_flin.diminfo[2].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_q_kr_up.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_q_kr_up.diminfo[1].strides)));
13144 __pyx_t_25 = __pyx_v_nDOF_trial_element;
13145 for (__pyx_t_26 = 0; __pyx_t_26 < __pyx_t_25; __pyx_t_26+=1) {
13146 __pyx_v_j = __pyx_t_26;
13155 __pyx_t_30 = __pyx_v_nSpace;
13156 for (__pyx_t_40 = 0; __pyx_t_40 < __pyx_t_30; __pyx_t_40+=1) {
13157 __pyx_v_I = __pyx_t_40;
13166 __pyx_t_41 = (__pyx_v_I + 1);
13168 if (__pyx_t_41 < 0) {
13169 __pyx_t_41 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13170 if (unlikely(__pyx_t_41 < 0)) __pyx_t_42 = 0;
13171 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_42 = 0;
13172 if (unlikely(__pyx_t_42 != -1)) {
13173 __Pyx_RaiseBufferIndexError(__pyx_t_42);
13174 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13176 __pyx_t_43 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_41, __pyx_pybuffernd_rowptr.diminfo[0].strides));
13177 __pyx_t_44 = __pyx_v_I;
13179 if (__pyx_t_44 < 0) {
13180 __pyx_t_44 += __pyx_pybuffernd_rowptr.diminfo[0].shape;
13181 if (unlikely(__pyx_t_44 < 0)) __pyx_t_42 = 0;
13182 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_rowptr.diminfo[0].shape)) __pyx_t_42 = 0;
13183 if (unlikely(__pyx_t_42 != -1)) {
13184 __Pyx_RaiseBufferIndexError(__pyx_t_42);
13185 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 664; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13187 for (__pyx_t_42 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_rowptr.rcbuffer->pybuffer.buf, __pyx_t_44, __pyx_pybuffernd_rowptr.diminfo[0].strides)); __pyx_t_42 < __pyx_t_43; __pyx_t_42+=1) {
13188 __pyx_v_ii = __pyx_t_42;
13197 __pyx_t_45 = __pyx_v_ii;
13199 if (__pyx_t_45 < 0) {
13200 __pyx_t_45 += __pyx_pybuffernd_a_up.diminfo[0].shape;
13201 if (unlikely(__pyx_t_45 < 0)) __pyx_t_46 = 0;
13202 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_a_up.diminfo[0].shape)) __pyx_t_46 = 0;
13203 if (unlikely(__pyx_t_46 != -1)) {
13204 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13205 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13207 __pyx_t_47 = __pyx_v_ii;
13209 if (__pyx_t_47 < 0) {
13210 __pyx_t_47 += __pyx_pybuffernd_colind.diminfo[0].shape;
13211 if (unlikely(__pyx_t_47 < 0)) __pyx_t_46 = 0;
13212 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_colind.diminfo[0].shape)) __pyx_t_46 = 0;
13213 if (unlikely(__pyx_t_46 != -1)) {
13214 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13215 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13217 __pyx_t_48 = __pyx_v_eN;
13218 __pyx_t_49 = __pyx_v_ebN;
13219 __pyx_t_50 = __pyx_v_j;
13220 __pyx_t_51 = (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_colind.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_colind.diminfo[0].strides));
13222 if (__pyx_t_48 < 0) {
13223 __pyx_t_48 += __pyx_pybuffernd_q_grad_v.diminfo[0].shape;
13224 if (unlikely(__pyx_t_48 < 0)) __pyx_t_46 = 0;
13225 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_q_grad_v.diminfo[0].shape)) __pyx_t_46 = 0;
13226 if (__pyx_t_49 < 0) {
13227 __pyx_t_49 += __pyx_pybuffernd_q_grad_v.diminfo[1].shape;
13228 if (unlikely(__pyx_t_49 < 0)) __pyx_t_46 = 1;
13229 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_q_grad_v.diminfo[1].shape)) __pyx_t_46 = 1;
13230 if (__pyx_t_50 < 0) {
13231 __pyx_t_50 += __pyx_pybuffernd_q_grad_v.diminfo[2].shape;
13232 if (unlikely(__pyx_t_50 < 0)) __pyx_t_46 = 2;
13233 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_q_grad_v.diminfo[2].shape)) __pyx_t_46 = 2;
13234 if (__pyx_t_51 < 0) {
13235 __pyx_t_51 += __pyx_pybuffernd_q_grad_v.diminfo[3].shape;
13236 if (unlikely(__pyx_t_51 < 0)) __pyx_t_46 = 3;
13237 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_q_grad_v.diminfo[3].shape)) __pyx_t_46 = 3;
13238 if (unlikely(__pyx_t_46 != -1)) {
13239 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13240 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13242 __pyx_t_52 = __pyx_v_eN;
13243 __pyx_t_53 = __pyx_v_ebN;
13244 __pyx_t_54 = __pyx_v_i;
13245 __pyx_t_55 = __pyx_v_I;
13247 if (__pyx_t_52 < 0) {
13248 __pyx_t_52 += __pyx_pybuffernd_q_grad_w.diminfo[0].shape;
13249 if (unlikely(__pyx_t_52 < 0)) __pyx_t_46 = 0;
13250 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_q_grad_w.diminfo[0].shape)) __pyx_t_46 = 0;
13251 if (__pyx_t_53 < 0) {
13252 __pyx_t_53 += __pyx_pybuffernd_q_grad_w.diminfo[1].shape;
13253 if (unlikely(__pyx_t_53 < 0)) __pyx_t_46 = 1;
13254 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_q_grad_w.diminfo[1].shape)) __pyx_t_46 = 1;
13255 if (__pyx_t_54 < 0) {
13256 __pyx_t_54 += __pyx_pybuffernd_q_grad_w.diminfo[2].shape;
13257 if (unlikely(__pyx_t_54 < 0)) __pyx_t_46 = 2;
13258 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_q_grad_w.diminfo[2].shape)) __pyx_t_46 = 2;
13259 if (__pyx_t_55 < 0) {
13260 __pyx_t_55 += __pyx_pybuffernd_q_grad_w.diminfo[3].shape;
13261 if (unlikely(__pyx_t_55 < 0)) __pyx_t_46 = 3;
13262 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_q_grad_w.diminfo[3].shape)) __pyx_t_46 = 3;
13263 if (unlikely(__pyx_t_46 != -1)) {
13264 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13265 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13267 __pyx_t_56 = __pyx_v_eN;
13268 __pyx_t_57 = __pyx_v_i;
13269 __pyx_t_58 = __pyx_v_j;
13271 if (__pyx_t_56 < 0) {
13272 __pyx_t_56 += __pyx_pybuffernd_elementJacobian.diminfo[0].shape;
13273 if (unlikely(__pyx_t_56 < 0)) __pyx_t_46 = 0;
13274 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_elementJacobian.diminfo[0].shape)) __pyx_t_46 = 0;
13275 if (__pyx_t_57 < 0) {
13276 __pyx_t_57 += __pyx_pybuffernd_elementJacobian.diminfo[1].shape;
13277 if (unlikely(__pyx_t_57 < 0)) __pyx_t_46 = 1;
13278 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_elementJacobian.diminfo[1].shape)) __pyx_t_46 = 1;
13279 if (__pyx_t_58 < 0) {
13280 __pyx_t_58 += __pyx_pybuffernd_elementJacobian.diminfo[2].shape;
13281 if (unlikely(__pyx_t_58 < 0)) __pyx_t_46 = 2;
13282 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_elementJacobian.diminfo[2].shape)) __pyx_t_46 = 2;
13283 if (unlikely(__pyx_t_46 != -1)) {
13284 __Pyx_RaiseBufferIndexError(__pyx_t_46);
13285 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 665; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13287 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer.buf, __pyx_t_56, __pyx_pybuffernd_elementJacobian.diminfo[0].strides, __pyx_t_57, __pyx_pybuffernd_elementJacobian.diminfo[1].strides, __pyx_t_58, __pyx_pybuffernd_elementJacobian.diminfo[2].strides) += (((__pyx_v_weight * (*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_a_up.rcbuffer->pybuffer.buf, __pyx_t_45, __pyx_pybuffernd_a_up.diminfo[0].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer.buf, __pyx_t_48, __pyx_pybuffernd_q_grad_v.diminfo[0].strides, __pyx_t_49, __pyx_pybuffernd_q_grad_v.diminfo[1].strides, __pyx_t_50, __pyx_pybuffernd_q_grad_v.diminfo[2].strides, __pyx_t_51, __pyx_pybuffernd_q_grad_v.diminfo[3].strides))) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_q_grad_w.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_q_grad_w.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_q_grad_w.diminfo[2].strides, __pyx_t_55, __pyx_pybuffernd_q_grad_w.diminfo[3].strides)));
13304 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13307 __Pyx_XDECREF(__pyx_t_1);
13308 __Pyx_XDECREF(__pyx_t_2);
13309 __Pyx_XDECREF(__pyx_t_4);
13310 __Pyx_XDECREF(__pyx_t_5);
13311 __Pyx_XDECREF(__pyx_t_9);
13312 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13313 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13314 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13315 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13316 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13317 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
13318 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13319 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13320 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13321 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13322 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13323 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
13324 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
13325 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
13326 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13327 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13328 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
13329 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13330 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13331 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13332 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13333 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13334 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13335 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13336 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13337 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13338 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.RE_NCP1_getElementJacobian", __pyx_clineno, __pyx_lineno, __pyx_filename);
13342 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_a_up.rcbuffer->pybuffer);
13343 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colind.rcbuffer->pybuffer);
13344 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementBarycentersArray.rcbuffer->pybuffer);
13345 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementJacobian.rcbuffer->pybuffer);
13346 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_elementNeighborsArray.rcbuffer->pybuffer);
13347 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_f_up.rcbuffer->pybuffer);
13348 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_gravity.rcbuffer->pybuffer);
13349 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_alin.rcbuffer->pybuffer);
13350 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_detJ.rcbuffer->pybuffer);
13351 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dkr.rcbuffer->pybuffer);
13352 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dm.rcbuffer->pybuffer);
13353 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_dmt.rcbuffer->pybuffer);
13354 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_flin.rcbuffer->pybuffer);
13355 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_u.rcbuffer->pybuffer);
13356 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_v.rcbuffer->pybuffer);
13357 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_grad_w.rcbuffer->pybuffer);
13358 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr.rcbuffer->pybuffer);
13359 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_kr_up.rcbuffer->pybuffer);
13360 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_m.rcbuffer->pybuffer);
13361 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_mt.rcbuffer->pybuffer);
13362 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_r.rcbuffer->pybuffer);
13363 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_q_u.rcbuffer->pybuffer);
13364 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_rowptr.rcbuffer->pybuffer);
13366 __Pyx_XDECREF(__pyx_v_q);
13367 __Pyx_XDECREF((PyObject *)__pyx_v_a_up);
13368 __Pyx_XDECREF((PyObject *)__pyx_v_f_up);
13369 __Pyx_XGIVEREF(__pyx_r);
13370 __Pyx_RefNannyFinishContext();
13383 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13384 static char __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg[] =
"\n approximate element mass term as (\010ar{c}_e,w_{h,i})_e\n ";
13385 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg = {
"updateMass_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_36updateMass_weakAvg};
13386 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_37updateMass_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13387 PyArrayObject *__pyx_v_mt = 0;
13388 PyArrayObject *__pyx_v_w = 0;
13389 PyArrayObject *__pyx_v_dV = 0;
13390 PyArrayObject *__pyx_v_weak_residual = 0;
13391 int __pyx_lineno = 0;
13392 const char *__pyx_filename = NULL;
13393 int __pyx_clineno = 0;
13394 PyObject *__pyx_r = 0;
13395 __Pyx_RefNannyDeclarations
13396 __Pyx_RefNannySetupContext(
"updateMass_weakAvg (wrapper)", 0);
13398 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_mt,&__pyx_n_s_w,&__pyx_n_s_dV,&__pyx_n_s_weak_residual,0};
13399 PyObject* values[4] = {0,0,0,0};
13400 if (unlikely(__pyx_kwds)) {
13401 Py_ssize_t kw_args;
13402 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13403 switch (pos_args) {
13404 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13405 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13406 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13407 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13409 default:
goto __pyx_L5_argtuple_error;
13411 kw_args = PyDict_Size(__pyx_kwds);
13412 switch (pos_args) {
13414 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_mt)) != 0)) kw_args--;
13415 else goto __pyx_L5_argtuple_error;
13417 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
13419 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13422 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
13424 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13427 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_weak_residual)) != 0)) kw_args--;
13429 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13432 if (unlikely(kw_args > 0)) {
13433 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMass_weakAvg") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13435 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
13436 goto __pyx_L5_argtuple_error;
13438 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13439 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13440 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13441 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13443 __pyx_v_mt = ((PyArrayObject *)values[0]);
13444 __pyx_v_w = ((PyArrayObject *)values[1]);
13445 __pyx_v_dV = ((PyArrayObject *)values[2]);
13446 __pyx_v_weak_residual = ((PyArrayObject *)values[3]);
13448 goto __pyx_L4_argument_unpacking_done;
13449 __pyx_L5_argtuple_error:;
13450 __Pyx_RaiseArgtupleInvalid(
"updateMass_weakAvg", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13452 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
13453 __Pyx_RefNannyFinishContext();
13455 __pyx_L4_argument_unpacking_done:;
13456 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_mt), __pyx_ptype_5numpy_ndarray, 1,
"mt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13457 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 674; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13458 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 675; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13459 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"weak_residual", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 676; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13460 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(__pyx_self, __pyx_v_mt, __pyx_v_w, __pyx_v_dV, __pyx_v_weak_residual);
13467 __Pyx_RefNannyFinishContext();
13471 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_36updateMass_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_mt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_weak_residual) {
13475 PyObject *__pyx_v_mt_avg = 0;
13476 PyObject *__pyx_v_vol = 0;
13477 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
13478 __Pyx_Buffer __pyx_pybuffer_dV;
13479 __Pyx_LocalBuf_ND __pyx_pybuffernd_mt;
13480 __Pyx_Buffer __pyx_pybuffer_mt;
13481 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
13482 __Pyx_Buffer __pyx_pybuffer_w;
13483 __Pyx_LocalBuf_ND __pyx_pybuffernd_weak_residual;
13484 __Pyx_Buffer __pyx_pybuffer_weak_residual;
13485 PyObject *__pyx_r = NULL;
13486 __Pyx_RefNannyDeclarations
13487 npy_intp __pyx_t_1;
13489 npy_intp __pyx_t_3;
13491 Py_ssize_t __pyx_t_5;
13492 Py_ssize_t __pyx_t_6;
13494 Py_ssize_t __pyx_t_8;
13495 Py_ssize_t __pyx_t_9;
13496 PyObject *__pyx_t_10 = NULL;
13497 PyObject *__pyx_t_11 = NULL;
13498 Py_ssize_t __pyx_t_12;
13499 Py_ssize_t __pyx_t_13;
13500 Py_ssize_t __pyx_t_14;
13501 Py_ssize_t __pyx_t_15;
13502 Py_ssize_t __pyx_t_16;
13503 Py_ssize_t __pyx_t_17;
13504 Py_ssize_t __pyx_t_18;
13505 PyObject *__pyx_t_19 = NULL;
13507 Py_ssize_t __pyx_t_21;
13508 Py_ssize_t __pyx_t_22;
13509 int __pyx_lineno = 0;
13510 const char *__pyx_filename = NULL;
13511 int __pyx_clineno = 0;
13512 __Pyx_RefNannySetupContext(
"updateMass_weakAvg", 0);
13513 __pyx_pybuffer_mt.pybuffer.buf = NULL;
13514 __pyx_pybuffer_mt.refcount = 0;
13515 __pyx_pybuffernd_mt.data = NULL;
13516 __pyx_pybuffernd_mt.rcbuffer = &__pyx_pybuffer_mt;
13517 __pyx_pybuffer_w.pybuffer.buf = NULL;
13518 __pyx_pybuffer_w.refcount = 0;
13519 __pyx_pybuffernd_w.data = NULL;
13520 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
13521 __pyx_pybuffer_dV.pybuffer.buf = NULL;
13522 __pyx_pybuffer_dV.refcount = 0;
13523 __pyx_pybuffernd_dV.data = NULL;
13524 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
13525 __pyx_pybuffer_weak_residual.pybuffer.buf = NULL;
13526 __pyx_pybuffer_weak_residual.refcount = 0;
13527 __pyx_pybuffernd_weak_residual.data = NULL;
13528 __pyx_pybuffernd_weak_residual.rcbuffer = &__pyx_pybuffer_weak_residual;
13530 __Pyx_BufFmt_StackElem __pyx_stack[1];
13531 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mt.rcbuffer->pybuffer, (PyObject*)__pyx_v_mt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13533 __pyx_pybuffernd_mt.diminfo[0].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mt.diminfo[0].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_mt.diminfo[1].strides = __pyx_pybuffernd_mt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_mt.diminfo[1].shape = __pyx_pybuffernd_mt.rcbuffer->pybuffer.shape[1];
13535 __Pyx_BufFmt_StackElem __pyx_stack[1];
13536 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13538 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
13540 __Pyx_BufFmt_StackElem __pyx_stack[1];
13541 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13543 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
13545 __Pyx_BufFmt_StackElem __pyx_stack[1];
13546 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13548 __pyx_pybuffernd_weak_residual.diminfo[0].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_weak_residual.diminfo[0].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_weak_residual.diminfo[1].strides = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_weak_residual.diminfo[1].shape = __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.shape[1];
13557 __pyx_t_1 = (__pyx_v_mt->dimensions[0]);
13558 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
13559 __pyx_v_eN = __pyx_t_2;
13568 __Pyx_INCREF(__pyx_float_0_0);
13569 __Pyx_XDECREF_SET(__pyx_v_mt_avg, __pyx_float_0_0);
13578 __Pyx_INCREF(__pyx_float_0_0);
13579 __Pyx_XDECREF_SET(__pyx_v_vol, __pyx_float_0_0);
13588 __pyx_t_3 = (__pyx_v_mt->dimensions[1]);
13589 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
13590 __pyx_v_k = __pyx_t_4;
13599 __pyx_t_5 = __pyx_v_eN;
13600 __pyx_t_6 = __pyx_v_k;
13602 if (__pyx_t_5 < 0) {
13603 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
13604 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
13605 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
13606 if (__pyx_t_6 < 0) {
13607 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
13608 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
13609 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
13610 if (unlikely(__pyx_t_7 != -1)) {
13611 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13612 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13614 __pyx_t_8 = __pyx_v_eN;
13615 __pyx_t_9 = __pyx_v_k;
13617 if (__pyx_t_8 < 0) {
13618 __pyx_t_8 += __pyx_pybuffernd_mt.diminfo[0].shape;
13619 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
13620 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_mt.diminfo[0].shape)) __pyx_t_7 = 0;
13621 if (__pyx_t_9 < 0) {
13622 __pyx_t_9 += __pyx_pybuffernd_mt.diminfo[1].shape;
13623 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
13624 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_mt.diminfo[1].shape)) __pyx_t_7 = 1;
13625 if (unlikely(__pyx_t_7 != -1)) {
13626 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13627 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13629 __pyx_t_10 = PyFloat_FromDouble(((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_mt.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_mt.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_mt.diminfo[1].strides))));
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13630 __Pyx_GOTREF(__pyx_t_10);
13631 __pyx_t_11 = PyNumber_InPlaceAdd(__pyx_v_mt_avg, __pyx_t_10);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 686; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13632 __Pyx_GOTREF(__pyx_t_11);
13633 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13634 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_11);
13644 __pyx_t_12 = __pyx_v_eN;
13645 __pyx_t_13 = __pyx_v_k;
13647 if (__pyx_t_12 < 0) {
13648 __pyx_t_12 += __pyx_pybuffernd_dV.diminfo[0].shape;
13649 if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
13650 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
13651 if (__pyx_t_13 < 0) {
13652 __pyx_t_13 += __pyx_pybuffernd_dV.diminfo[1].shape;
13653 if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 1;
13654 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
13655 if (unlikely(__pyx_t_7 != -1)) {
13656 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13657 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13659 __pyx_t_11 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13660 __Pyx_GOTREF(__pyx_t_11);
13661 __pyx_t_10 = PyNumber_InPlaceAdd(__pyx_v_vol, __pyx_t_11);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 687; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13662 __Pyx_GOTREF(__pyx_t_10);
13663 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13664 __Pyx_DECREF_SET(__pyx_v_vol, __pyx_t_10);
13675 __pyx_t_10 = __Pyx_PyNumber_InPlaceDivide(__pyx_v_mt_avg, __pyx_v_vol);
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 688; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13676 __Pyx_GOTREF(__pyx_t_10);
13677 __Pyx_DECREF_SET(__pyx_v_mt_avg, __pyx_t_10);
13687 __pyx_t_3 = (__pyx_v_weak_residual->dimensions[1]);
13688 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
13689 __pyx_v_i = __pyx_t_4;
13698 __pyx_t_14 = __pyx_v_eN;
13699 __pyx_t_15 = __pyx_v_k;
13700 __pyx_t_16 = __pyx_v_i;
13702 if (__pyx_t_14 < 0) {
13703 __pyx_t_14 += __pyx_pybuffernd_w.diminfo[0].shape;
13704 if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
13705 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_7 = 0;
13706 if (__pyx_t_15 < 0) {
13707 __pyx_t_15 += __pyx_pybuffernd_w.diminfo[1].shape;
13708 if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 1;
13709 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_7 = 1;
13710 if (__pyx_t_16 < 0) {
13711 __pyx_t_16 += __pyx_pybuffernd_w.diminfo[2].shape;
13712 if (unlikely(__pyx_t_16 < 0)) __pyx_t_7 = 2;
13713 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_7 = 2;
13714 if (unlikely(__pyx_t_7 != -1)) {
13715 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13716 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13718 __pyx_t_10 = PyFloat_FromDouble((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_w.diminfo[2].strides)));
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13719 __Pyx_GOTREF(__pyx_t_10);
13720 __pyx_t_11 = PyNumber_Multiply(__pyx_v_mt_avg, __pyx_t_10);
if (unlikely(!__pyx_t_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13721 __Pyx_GOTREF(__pyx_t_11);
13722 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13723 __pyx_t_17 = __pyx_v_eN;
13724 __pyx_t_18 = __pyx_v_k;
13726 if (__pyx_t_17 < 0) {
13727 __pyx_t_17 += __pyx_pybuffernd_dV.diminfo[0].shape;
13728 if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
13729 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
13730 if (__pyx_t_18 < 0) {
13731 __pyx_t_18 += __pyx_pybuffernd_dV.diminfo[1].shape;
13732 if (unlikely(__pyx_t_18 < 0)) __pyx_t_7 = 1;
13733 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
13734 if (unlikely(__pyx_t_7 != -1)) {
13735 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13736 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13738 __pyx_t_10 = PyFloat_FromDouble((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_dV.diminfo[1].strides)));
if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13739 __Pyx_GOTREF(__pyx_t_10);
13740 __pyx_t_19 = PyNumber_Multiply(__pyx_t_11, __pyx_t_10);
if (unlikely(!__pyx_t_19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13741 __Pyx_GOTREF(__pyx_t_19);
13742 __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
13743 __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
13744 __pyx_t_20 = __Pyx_PyObject_AsDouble(__pyx_t_19);
if (unlikely(__pyx_t_20 == ((
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13745 __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
13746 __pyx_t_21 = __pyx_v_eN;
13747 __pyx_t_22 = __pyx_v_i;
13749 if (__pyx_t_21 < 0) {
13750 __pyx_t_21 += __pyx_pybuffernd_weak_residual.diminfo[0].shape;
13751 if (unlikely(__pyx_t_21 < 0)) __pyx_t_7 = 0;
13752 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_weak_residual.diminfo[0].shape)) __pyx_t_7 = 0;
13753 if (__pyx_t_22 < 0) {
13754 __pyx_t_22 += __pyx_pybuffernd_weak_residual.diminfo[1].shape;
13755 if (unlikely(__pyx_t_22 < 0)) __pyx_t_7 = 1;
13756 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_weak_residual.diminfo[1].shape)) __pyx_t_7 = 1;
13757 if (unlikely(__pyx_t_7 != -1)) {
13758 __Pyx_RaiseBufferIndexError(__pyx_t_7);
13759 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 691; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13761 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_weak_residual.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_weak_residual.diminfo[1].strides) += __pyx_t_20;
13774 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
13777 __Pyx_XDECREF(__pyx_t_10);
13778 __Pyx_XDECREF(__pyx_t_11);
13779 __Pyx_XDECREF(__pyx_t_19);
13780 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
13781 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
13782 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
13783 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
13784 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
13785 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
13786 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
13787 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMass_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
13791 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
13792 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mt.rcbuffer->pybuffer);
13793 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
13794 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_weak_residual.rcbuffer->pybuffer);
13796 __Pyx_XDECREF(__pyx_v_mt_avg);
13797 __Pyx_XDECREF(__pyx_v_vol);
13798 __Pyx_XGIVEREF(__pyx_r);
13799 __Pyx_RefNannyFinishContext();
13812 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
13813 static char __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg[] =
"\n approximate element mass Jacobian term as (\\pd{\010ar{c}_e}{u_j},w_{h,i})_e\n ";
13814 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg = {
"updateMassJacobian_weakAvg", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg};
13815 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13816 PyArrayObject *__pyx_v_dmt = 0;
13817 PyArrayObject *__pyx_v_w = 0;
13818 PyArrayObject *__pyx_v_v = 0;
13819 PyArrayObject *__pyx_v_dV = 0;
13820 PyArrayObject *__pyx_v_jacobian_weak_residual = 0;
13821 int __pyx_lineno = 0;
13822 const char *__pyx_filename = NULL;
13823 int __pyx_clineno = 0;
13824 PyObject *__pyx_r = 0;
13825 __Pyx_RefNannyDeclarations
13826 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg (wrapper)", 0);
13828 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_dmt,&__pyx_n_s_w,&__pyx_n_s_v,&__pyx_n_s_dV,&__pyx_n_s_jacobian_weak_residual,0};
13829 PyObject* values[5] = {0,0,0,0,0};
13830 if (unlikely(__pyx_kwds)) {
13831 Py_ssize_t kw_args;
13832 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13833 switch (pos_args) {
13834 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13835 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13836 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13837 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13838 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13840 default:
goto __pyx_L5_argtuple_error;
13842 kw_args = PyDict_Size(__pyx_kwds);
13843 switch (pos_args) {
13845 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dmt)) != 0)) kw_args--;
13846 else goto __pyx_L5_argtuple_error;
13848 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
13850 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13853 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
13855 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13858 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
13860 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13863 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_jacobian_weak_residual)) != 0)) kw_args--;
13865 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13868 if (unlikely(kw_args > 0)) {
13869 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"updateMassJacobian_weakAvg") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13871 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
13872 goto __pyx_L5_argtuple_error;
13874 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13875 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13876 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13877 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
13878 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
13880 __pyx_v_dmt = ((PyArrayObject *)values[0]);
13881 __pyx_v_w = ((PyArrayObject *)values[1]);
13882 __pyx_v_v = ((PyArrayObject *)values[2]);
13883 __pyx_v_dV = ((PyArrayObject *)values[3]);
13884 __pyx_v_jacobian_weak_residual = ((PyArrayObject *)values[4]);
13886 goto __pyx_L4_argument_unpacking_done;
13887 __pyx_L5_argtuple_error:;
13888 __Pyx_RaiseArgtupleInvalid(
"updateMassJacobian_weakAvg", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
13890 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
13891 __Pyx_RefNannyFinishContext();
13893 __pyx_L4_argument_unpacking_done:;
13894 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dmt), __pyx_ptype_5numpy_ndarray, 1,
"dmt", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13895 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_w), __pyx_ptype_5numpy_ndarray, 1,
"w", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 693; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13896 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 694; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13897 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 695; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13898 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_jacobian_weak_residual), __pyx_ptype_5numpy_ndarray, 1,
"jacobian_weak_residual", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 696; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13899 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(__pyx_self, __pyx_v_dmt, __pyx_v_w, __pyx_v_v, __pyx_v_dV, __pyx_v_jacobian_weak_residual);
13906 __Pyx_RefNannyFinishContext();
13910 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_38updateMassJacobian_weakAvg(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_dmt, PyArrayObject *__pyx_v_w, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_dV, PyArrayObject *__pyx_v_jacobian_weak_residual) {
13915 double __pyx_v_dmtj_avg;
13916 double __pyx_v_vol;
13917 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
13918 __Pyx_Buffer __pyx_pybuffer_dV;
13919 __Pyx_LocalBuf_ND __pyx_pybuffernd_dmt;
13920 __Pyx_Buffer __pyx_pybuffer_dmt;
13921 __Pyx_LocalBuf_ND __pyx_pybuffernd_jacobian_weak_residual;
13922 __Pyx_Buffer __pyx_pybuffer_jacobian_weak_residual;
13923 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
13924 __Pyx_Buffer __pyx_pybuffer_v;
13925 __Pyx_LocalBuf_ND __pyx_pybuffernd_w;
13926 __Pyx_Buffer __pyx_pybuffer_w;
13927 PyObject *__pyx_r = NULL;
13928 __Pyx_RefNannyDeclarations
13929 npy_intp __pyx_t_1;
13931 npy_intp __pyx_t_3;
13933 Py_ssize_t __pyx_t_5;
13934 Py_ssize_t __pyx_t_6;
13936 npy_intp __pyx_t_8;
13937 npy_intp __pyx_t_9;
13939 Py_ssize_t __pyx_t_11;
13940 Py_ssize_t __pyx_t_12;
13942 Py_ssize_t __pyx_t_14;
13943 Py_ssize_t __pyx_t_15;
13944 Py_ssize_t __pyx_t_16;
13945 Py_ssize_t __pyx_t_17;
13946 Py_ssize_t __pyx_t_18;
13947 Py_ssize_t __pyx_t_19;
13948 Py_ssize_t __pyx_t_20;
13949 Py_ssize_t __pyx_t_21;
13950 Py_ssize_t __pyx_t_22;
13951 Py_ssize_t __pyx_t_23;
13952 Py_ssize_t __pyx_t_24;
13953 Py_ssize_t __pyx_t_25;
13954 Py_ssize_t __pyx_t_26;
13955 int __pyx_lineno = 0;
13956 const char *__pyx_filename = NULL;
13957 int __pyx_clineno = 0;
13958 __Pyx_RefNannySetupContext(
"updateMassJacobian_weakAvg", 0);
13959 __pyx_pybuffer_dmt.pybuffer.buf = NULL;
13960 __pyx_pybuffer_dmt.refcount = 0;
13961 __pyx_pybuffernd_dmt.data = NULL;
13962 __pyx_pybuffernd_dmt.rcbuffer = &__pyx_pybuffer_dmt;
13963 __pyx_pybuffer_w.pybuffer.buf = NULL;
13964 __pyx_pybuffer_w.refcount = 0;
13965 __pyx_pybuffernd_w.data = NULL;
13966 __pyx_pybuffernd_w.rcbuffer = &__pyx_pybuffer_w;
13967 __pyx_pybuffer_v.pybuffer.buf = NULL;
13968 __pyx_pybuffer_v.refcount = 0;
13969 __pyx_pybuffernd_v.data = NULL;
13970 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
13971 __pyx_pybuffer_dV.pybuffer.buf = NULL;
13972 __pyx_pybuffer_dV.refcount = 0;
13973 __pyx_pybuffernd_dV.data = NULL;
13974 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
13975 __pyx_pybuffer_jacobian_weak_residual.pybuffer.buf = NULL;
13976 __pyx_pybuffer_jacobian_weak_residual.refcount = 0;
13977 __pyx_pybuffernd_jacobian_weak_residual.data = NULL;
13978 __pyx_pybuffernd_jacobian_weak_residual.rcbuffer = &__pyx_pybuffer_jacobian_weak_residual;
13980 __Pyx_BufFmt_StackElem __pyx_stack[1];
13981 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer, (PyObject*)__pyx_v_dmt, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13983 __pyx_pybuffernd_dmt.diminfo[0].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dmt.diminfo[0].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dmt.diminfo[1].strides = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dmt.diminfo[1].shape = __pyx_pybuffernd_dmt.rcbuffer->pybuffer.shape[1];
13985 __Pyx_BufFmt_StackElem __pyx_stack[1];
13986 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_w.rcbuffer->pybuffer, (PyObject*)__pyx_v_w, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13988 __pyx_pybuffernd_w.diminfo[0].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_w.diminfo[0].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_w.diminfo[1].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_w.diminfo[1].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_w.diminfo[2].strides = __pyx_pybuffernd_w.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_w.diminfo[2].shape = __pyx_pybuffernd_w.rcbuffer->pybuffer.shape[2];
13990 __Pyx_BufFmt_StackElem __pyx_stack[1];
13991 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13993 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
13995 __Pyx_BufFmt_StackElem __pyx_stack[1];
13996 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
13998 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14000 __Pyx_BufFmt_StackElem __pyx_stack[1];
14001 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer, (PyObject*)__pyx_v_jacobian_weak_residual, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14003 __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape = __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.shape[2];
14012 __pyx_t_1 = (__pyx_v_dmt->dimensions[0]);
14013 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
14014 __pyx_v_eN = __pyx_t_2;
14032 __pyx_t_3 = (__pyx_v_dmt->dimensions[1]);
14033 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14034 __pyx_v_k = __pyx_t_4;
14043 __pyx_t_5 = __pyx_v_eN;
14044 __pyx_t_6 = __pyx_v_k;
14046 if (__pyx_t_5 < 0) {
14047 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
14048 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
14049 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14050 if (__pyx_t_6 < 0) {
14051 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
14052 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
14053 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14054 if (unlikely(__pyx_t_7 != -1)) {
14055 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14056 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 705; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14058 __pyx_v_vol = (__pyx_v_vol + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
14068 __pyx_t_3 = (__pyx_v_w->dimensions[2]);
14069 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14070 __pyx_v_i = __pyx_t_4;
14079 __pyx_t_8 = (__pyx_v_v->dimensions[2]);
14080 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_8; __pyx_t_7+=1) {
14081 __pyx_v_j = __pyx_t_7;
14090 __pyx_v_dmtj_avg = 0.0;
14099 __pyx_t_9 = (__pyx_v_dmt->dimensions[1]);
14100 for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_9; __pyx_t_10+=1) {
14101 __pyx_v_k = __pyx_t_10;
14110 __pyx_t_11 = __pyx_v_eN;
14111 __pyx_t_12 = __pyx_v_k;
14113 if (__pyx_t_11 < 0) {
14114 __pyx_t_11 += __pyx_pybuffernd_dV.diminfo[0].shape;
14115 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 0;
14116 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_13 = 0;
14117 if (__pyx_t_12 < 0) {
14118 __pyx_t_12 += __pyx_pybuffernd_dV.diminfo[1].shape;
14119 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 1;
14120 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_13 = 1;
14121 if (unlikely(__pyx_t_13 != -1)) {
14122 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14123 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14125 __pyx_t_14 = __pyx_v_eN;
14126 __pyx_t_15 = __pyx_v_k;
14128 if (__pyx_t_14 < 0) {
14129 __pyx_t_14 += __pyx_pybuffernd_dmt.diminfo[0].shape;
14130 if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
14131 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_dmt.diminfo[0].shape)) __pyx_t_13 = 0;
14132 if (__pyx_t_15 < 0) {
14133 __pyx_t_15 += __pyx_pybuffernd_dmt.diminfo[1].shape;
14134 if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
14135 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_dmt.diminfo[1].shape)) __pyx_t_13 = 1;
14136 if (unlikely(__pyx_t_13 != -1)) {
14137 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14138 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14140 __pyx_t_16 = __pyx_v_eN;
14141 __pyx_t_17 = __pyx_v_k;
14142 __pyx_t_18 = __pyx_v_j;
14144 if (__pyx_t_16 < 0) {
14145 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
14146 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 0;
14147 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_13 = 0;
14148 if (__pyx_t_17 < 0) {
14149 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
14150 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 1;
14151 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_13 = 1;
14152 if (__pyx_t_18 < 0) {
14153 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
14154 if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 2;
14155 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_13 = 2;
14156 if (unlikely(__pyx_t_13 != -1)) {
14157 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14158 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 710; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14160 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg + (((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_11, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_12, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dmt.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_dmt.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_dmt.diminfo[1].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides))));
14170 if (unlikely(__pyx_v_vol == 0)) {
14171 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14172 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 711; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14174 __pyx_v_dmtj_avg = (__pyx_v_dmtj_avg / __pyx_v_vol);
14183 __pyx_t_19 = __pyx_v_eN;
14184 __pyx_t_20 = __pyx_v_k;
14185 __pyx_t_21 = __pyx_v_i;
14187 if (__pyx_t_19 < 0) {
14188 __pyx_t_19 += __pyx_pybuffernd_w.diminfo[0].shape;
14189 if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
14190 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_w.diminfo[0].shape)) __pyx_t_10 = 0;
14191 if (__pyx_t_20 < 0) {
14192 __pyx_t_20 += __pyx_pybuffernd_w.diminfo[1].shape;
14193 if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 1;
14194 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_w.diminfo[1].shape)) __pyx_t_10 = 1;
14195 if (__pyx_t_21 < 0) {
14196 __pyx_t_21 += __pyx_pybuffernd_w.diminfo[2].shape;
14197 if (unlikely(__pyx_t_21 < 0)) __pyx_t_10 = 2;
14198 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_w.diminfo[2].shape)) __pyx_t_10 = 2;
14199 if (unlikely(__pyx_t_10 != -1)) {
14200 __Pyx_RaiseBufferIndexError(__pyx_t_10);
14201 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14203 __pyx_t_22 = __pyx_v_eN;
14204 __pyx_t_23 = __pyx_v_k;
14206 if (__pyx_t_22 < 0) {
14207 __pyx_t_22 += __pyx_pybuffernd_dV.diminfo[0].shape;
14208 if (unlikely(__pyx_t_22 < 0)) __pyx_t_10 = 0;
14209 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_10 = 0;
14210 if (__pyx_t_23 < 0) {
14211 __pyx_t_23 += __pyx_pybuffernd_dV.diminfo[1].shape;
14212 if (unlikely(__pyx_t_23 < 0)) __pyx_t_10 = 1;
14213 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_10 = 1;
14214 if (unlikely(__pyx_t_10 != -1)) {
14215 __Pyx_RaiseBufferIndexError(__pyx_t_10);
14216 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14218 __pyx_t_24 = __pyx_v_eN;
14219 __pyx_t_25 = __pyx_v_i;
14220 __pyx_t_26 = __pyx_v_j;
14222 if (__pyx_t_24 < 0) {
14223 __pyx_t_24 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape;
14224 if (unlikely(__pyx_t_24 < 0)) __pyx_t_10 = 0;
14225 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].shape)) __pyx_t_10 = 0;
14226 if (__pyx_t_25 < 0) {
14227 __pyx_t_25 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape;
14228 if (unlikely(__pyx_t_25 < 0)) __pyx_t_10 = 1;
14229 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].shape)) __pyx_t_10 = 1;
14230 if (__pyx_t_26 < 0) {
14231 __pyx_t_26 += __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape;
14232 if (unlikely(__pyx_t_26 < 0)) __pyx_t_10 = 2;
14233 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].shape)) __pyx_t_10 = 2;
14234 if (unlikely(__pyx_t_10 != -1)) {
14235 __Pyx_RaiseBufferIndexError(__pyx_t_10);
14236 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 712; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14238 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_jacobian_weak_residual.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_jacobian_weak_residual.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_jacobian_weak_residual.diminfo[2].strides) += ((__pyx_v_dmtj_avg * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_w.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_w.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_w.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_w.diminfo[2].strides))) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_22, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_23, __pyx_pybuffernd_dV.diminfo[1].strides)));
14252 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14255 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14256 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14257 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
14258 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
14259 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
14260 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
14261 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
14262 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14263 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.updateMassJacobian_weakAvg", __pyx_clineno, __pyx_lineno, __pyx_filename);
14267 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
14268 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dmt.rcbuffer->pybuffer);
14269 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_jacobian_weak_residual.rcbuffer->pybuffer);
14270 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
14271 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_w.rcbuffer->pybuffer);
14273 __Pyx_XGIVEREF(__pyx_r);
14274 __Pyx_RefNannyFinishContext();
14287 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14288 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux = {
"calculateNormalFlux", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux, METH_VARARGS|METH_KEYWORDS, 0};
14289 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_41calculateNormalFlux(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14290 PyArrayObject *__pyx_v_v = 0;
14291 PyArrayObject *__pyx_v_n = 0;
14292 PyArrayObject *__pyx_v_dS = 0;
14293 PyArrayObject *__pyx_v_flux = 0;
14294 int __pyx_lineno = 0;
14295 const char *__pyx_filename = NULL;
14296 int __pyx_clineno = 0;
14297 PyObject *__pyx_r = 0;
14298 __Pyx_RefNannyDeclarations
14299 __Pyx_RefNannySetupContext(
"calculateNormalFlux (wrapper)", 0);
14301 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_v,&__pyx_n_s_n,&__pyx_n_s_dS,&__pyx_n_s_flux,0};
14302 PyObject* values[4] = {0,0,0,0};
14303 if (unlikely(__pyx_kwds)) {
14304 Py_ssize_t kw_args;
14305 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14306 switch (pos_args) {
14307 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14308 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14309 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14310 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14312 default:
goto __pyx_L5_argtuple_error;
14314 kw_args = PyDict_Size(__pyx_kwds);
14315 switch (pos_args) {
14317 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
14318 else goto __pyx_L5_argtuple_error;
14320 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
14322 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14325 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dS)) != 0)) kw_args--;
14327 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14330 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_flux)) != 0)) kw_args--;
14332 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14335 if (unlikely(kw_args > 0)) {
14336 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"calculateNormalFlux") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14338 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14339 goto __pyx_L5_argtuple_error;
14341 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14342 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14343 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14344 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14346 __pyx_v_v = ((PyArrayObject *)values[0]);
14347 __pyx_v_n = ((PyArrayObject *)values[1]);
14348 __pyx_v_dS = ((PyArrayObject *)values[2]);
14349 __pyx_v_flux = ((PyArrayObject *)values[3]);
14351 goto __pyx_L4_argument_unpacking_done;
14352 __pyx_L5_argtuple_error:;
14353 __Pyx_RaiseArgtupleInvalid(
"calculateNormalFlux", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14355 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
14356 __Pyx_RefNannyFinishContext();
14358 __pyx_L4_argument_unpacking_done:;
14359 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14360 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_n), __pyx_ptype_5numpy_ndarray, 1,
"n", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 718; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14361 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dS), __pyx_ptype_5numpy_ndarray, 1,
"dS", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 719; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14362 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_flux), __pyx_ptype_5numpy_ndarray, 1,
"flux", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 720; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14363 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(__pyx_self, __pyx_v_v, __pyx_v_n, __pyx_v_dS, __pyx_v_flux);
14370 __Pyx_RefNannyFinishContext();
14374 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_40calculateNormalFlux(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_v, PyArrayObject *__pyx_v_n, PyArrayObject *__pyx_v_dS, PyArrayObject *__pyx_v_flux) {
14378 double __pyx_v_integral;
14379 npy_intp __pyx_v_I;
14380 __Pyx_LocalBuf_ND __pyx_pybuffernd_dS;
14381 __Pyx_Buffer __pyx_pybuffer_dS;
14382 __Pyx_LocalBuf_ND __pyx_pybuffernd_flux;
14383 __Pyx_Buffer __pyx_pybuffer_flux;
14384 __Pyx_LocalBuf_ND __pyx_pybuffernd_n;
14385 __Pyx_Buffer __pyx_pybuffer_n;
14386 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
14387 __Pyx_Buffer __pyx_pybuffer_v;
14388 PyObject *__pyx_r = NULL;
14389 __Pyx_RefNannyDeclarations
14390 npy_intp __pyx_t_1;
14392 npy_intp __pyx_t_3;
14394 npy_intp __pyx_t_5;
14396 npy_intp __pyx_t_7;
14397 npy_intp __pyx_t_8;
14398 Py_ssize_t __pyx_t_9;
14399 Py_ssize_t __pyx_t_10;
14400 Py_ssize_t __pyx_t_11;
14401 Py_ssize_t __pyx_t_12;
14403 Py_ssize_t __pyx_t_14;
14404 Py_ssize_t __pyx_t_15;
14405 Py_ssize_t __pyx_t_16;
14406 Py_ssize_t __pyx_t_17;
14407 Py_ssize_t __pyx_t_18;
14408 Py_ssize_t __pyx_t_19;
14409 Py_ssize_t __pyx_t_20;
14410 Py_ssize_t __pyx_t_21;
14411 Py_ssize_t __pyx_t_22;
14412 int __pyx_lineno = 0;
14413 const char *__pyx_filename = NULL;
14414 int __pyx_clineno = 0;
14415 __Pyx_RefNannySetupContext(
"calculateNormalFlux", 0);
14416 __pyx_pybuffer_v.pybuffer.buf = NULL;
14417 __pyx_pybuffer_v.refcount = 0;
14418 __pyx_pybuffernd_v.data = NULL;
14419 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
14420 __pyx_pybuffer_n.pybuffer.buf = NULL;
14421 __pyx_pybuffer_n.refcount = 0;
14422 __pyx_pybuffernd_n.data = NULL;
14423 __pyx_pybuffernd_n.rcbuffer = &__pyx_pybuffer_n;
14424 __pyx_pybuffer_dS.pybuffer.buf = NULL;
14425 __pyx_pybuffer_dS.refcount = 0;
14426 __pyx_pybuffernd_dS.data = NULL;
14427 __pyx_pybuffernd_dS.rcbuffer = &__pyx_pybuffer_dS;
14428 __pyx_pybuffer_flux.pybuffer.buf = NULL;
14429 __pyx_pybuffer_flux.refcount = 0;
14430 __pyx_pybuffernd_flux.data = NULL;
14431 __pyx_pybuffernd_flux.rcbuffer = &__pyx_pybuffer_flux;
14433 __Pyx_BufFmt_StackElem __pyx_stack[1];
14434 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14436 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
14438 __Pyx_BufFmt_StackElem __pyx_stack[1];
14439 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_n.rcbuffer->pybuffer, (PyObject*)__pyx_v_n, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14441 __pyx_pybuffernd_n.diminfo[0].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_n.diminfo[0].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_n.diminfo[1].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_n.diminfo[1].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_n.diminfo[2].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_n.diminfo[2].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_n.diminfo[3].strides = __pyx_pybuffernd_n.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_n.diminfo[3].shape = __pyx_pybuffernd_n.rcbuffer->pybuffer.shape[3];
14443 __Pyx_BufFmt_StackElem __pyx_stack[1];
14444 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dS.rcbuffer->pybuffer, (PyObject*)__pyx_v_dS, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14446 __pyx_pybuffernd_dS.diminfo[0].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dS.diminfo[0].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dS.diminfo[1].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dS.diminfo[1].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_dS.diminfo[2].strides = __pyx_pybuffernd_dS.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_dS.diminfo[2].shape = __pyx_pybuffernd_dS.rcbuffer->pybuffer.shape[2];
14448 __Pyx_BufFmt_StackElem __pyx_stack[1];
14449 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_flux.rcbuffer->pybuffer, (PyObject*)__pyx_v_flux, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14451 __pyx_pybuffernd_flux.diminfo[0].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_flux.diminfo[0].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_flux.diminfo[1].strides = __pyx_pybuffernd_flux.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_flux.diminfo[1].shape = __pyx_pybuffernd_flux.rcbuffer->pybuffer.shape[1];
14460 __pyx_t_1 = (__pyx_v_n->dimensions[0]);
14461 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
14462 __pyx_v_eN = __pyx_t_2;
14471 __pyx_t_3 = (__pyx_v_n->dimensions[1]);
14472 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14473 __pyx_v_ebN = __pyx_t_4;
14482 __pyx_v_integral = 0.0;
14491 __pyx_t_5 = (__pyx_v_n->dimensions[2]);
14492 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
14493 __pyx_v_kb = __pyx_t_6;
14502 __pyx_t_7 = (__pyx_v_n->dimensions[3]);
14503 for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
14504 __pyx_v_I = __pyx_t_8;
14513 __pyx_t_9 = __pyx_v_eN;
14514 __pyx_t_10 = __pyx_v_ebN;
14515 __pyx_t_11 = __pyx_v_kb;
14516 __pyx_t_12 = __pyx_v_I;
14518 if (__pyx_t_9 < 0) {
14519 __pyx_t_9 += __pyx_pybuffernd_v.diminfo[0].shape;
14520 if (unlikely(__pyx_t_9 < 0)) __pyx_t_13 = 0;
14521 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_13 = 0;
14522 if (__pyx_t_10 < 0) {
14523 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[1].shape;
14524 if (unlikely(__pyx_t_10 < 0)) __pyx_t_13 = 1;
14525 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_13 = 1;
14526 if (__pyx_t_11 < 0) {
14527 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[2].shape;
14528 if (unlikely(__pyx_t_11 < 0)) __pyx_t_13 = 2;
14529 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_13 = 2;
14530 if (__pyx_t_12 < 0) {
14531 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[3].shape;
14532 if (unlikely(__pyx_t_12 < 0)) __pyx_t_13 = 3;
14533 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_13 = 3;
14534 if (unlikely(__pyx_t_13 != -1)) {
14535 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14536 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14538 __pyx_t_14 = __pyx_v_eN;
14539 __pyx_t_15 = __pyx_v_ebN;
14540 __pyx_t_16 = __pyx_v_kb;
14541 __pyx_t_17 = __pyx_v_I;
14543 if (__pyx_t_14 < 0) {
14544 __pyx_t_14 += __pyx_pybuffernd_n.diminfo[0].shape;
14545 if (unlikely(__pyx_t_14 < 0)) __pyx_t_13 = 0;
14546 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_n.diminfo[0].shape)) __pyx_t_13 = 0;
14547 if (__pyx_t_15 < 0) {
14548 __pyx_t_15 += __pyx_pybuffernd_n.diminfo[1].shape;
14549 if (unlikely(__pyx_t_15 < 0)) __pyx_t_13 = 1;
14550 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_n.diminfo[1].shape)) __pyx_t_13 = 1;
14551 if (__pyx_t_16 < 0) {
14552 __pyx_t_16 += __pyx_pybuffernd_n.diminfo[2].shape;
14553 if (unlikely(__pyx_t_16 < 0)) __pyx_t_13 = 2;
14554 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_n.diminfo[2].shape)) __pyx_t_13 = 2;
14555 if (__pyx_t_17 < 0) {
14556 __pyx_t_17 += __pyx_pybuffernd_n.diminfo[3].shape;
14557 if (unlikely(__pyx_t_17 < 0)) __pyx_t_13 = 3;
14558 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_n.diminfo[3].shape)) __pyx_t_13 = 3;
14559 if (unlikely(__pyx_t_13 != -1)) {
14560 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14561 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14563 __pyx_t_18 = __pyx_v_eN;
14564 __pyx_t_19 = __pyx_v_ebN;
14565 __pyx_t_20 = __pyx_v_kb;
14567 if (__pyx_t_18 < 0) {
14568 __pyx_t_18 += __pyx_pybuffernd_dS.diminfo[0].shape;
14569 if (unlikely(__pyx_t_18 < 0)) __pyx_t_13 = 0;
14570 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_dS.diminfo[0].shape)) __pyx_t_13 = 0;
14571 if (__pyx_t_19 < 0) {
14572 __pyx_t_19 += __pyx_pybuffernd_dS.diminfo[1].shape;
14573 if (unlikely(__pyx_t_19 < 0)) __pyx_t_13 = 1;
14574 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_dS.diminfo[1].shape)) __pyx_t_13 = 1;
14575 if (__pyx_t_20 < 0) {
14576 __pyx_t_20 += __pyx_pybuffernd_dS.diminfo[2].shape;
14577 if (unlikely(__pyx_t_20 < 0)) __pyx_t_13 = 2;
14578 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_dS.diminfo[2].shape)) __pyx_t_13 = 2;
14579 if (unlikely(__pyx_t_13 != -1)) {
14580 __Pyx_RaiseBufferIndexError(__pyx_t_13);
14581 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 729; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14583 __pyx_v_integral = (__pyx_v_integral + (((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[3].strides)) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_n.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_n.diminfo[0].strides, __pyx_t_15, __pyx_pybuffernd_n.diminfo[1].strides, __pyx_t_16, __pyx_pybuffernd_n.diminfo[2].strides, __pyx_t_17, __pyx_pybuffernd_n.diminfo[3].strides))) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dS.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_dS.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_dS.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_dS.diminfo[2].strides))));
14594 __pyx_t_21 = __pyx_v_eN;
14595 __pyx_t_22 = __pyx_v_ebN;
14597 if (__pyx_t_21 < 0) {
14598 __pyx_t_21 += __pyx_pybuffernd_flux.diminfo[0].shape;
14599 if (unlikely(__pyx_t_21 < 0)) __pyx_t_6 = 0;
14600 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_flux.diminfo[0].shape)) __pyx_t_6 = 0;
14601 if (__pyx_t_22 < 0) {
14602 __pyx_t_22 += __pyx_pybuffernd_flux.diminfo[1].shape;
14603 if (unlikely(__pyx_t_22 < 0)) __pyx_t_6 = 1;
14604 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_flux.diminfo[1].shape)) __pyx_t_6 = 1;
14605 if (unlikely(__pyx_t_6 != -1)) {
14606 __Pyx_RaiseBufferIndexError(__pyx_t_6);
14607 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 730; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14609 *__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_flux.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_flux.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_flux.diminfo[1].strides) = __pyx_v_integral;
14622 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14625 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
14626 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
14627 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
14628 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
14629 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
14630 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
14631 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
14632 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.calculateNormalFlux", __pyx_clineno, __pyx_lineno, __pyx_filename);
14636 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dS.rcbuffer->pybuffer);
14637 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_flux.rcbuffer->pybuffer);
14638 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_n.rcbuffer->pybuffer);
14639 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
14641 __Pyx_XGIVEREF(__pyx_r);
14642 __Pyx_RefNannyFinishContext();
14655 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
14656 static char __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
14657 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity = {
"computeSimpleCharacteristicVelocityFromElementVelocity", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity};
14658 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14659 PyArrayObject *__pyx_v_df = 0;
14660 PyArrayObject *__pyx_v_characteristic_velocity = 0;
14661 PyArrayObject *__pyx_v_dm = 0;
14662 PyArrayObject *__pyx_v_dV = 0;
14663 int __pyx_lineno = 0;
14664 const char *__pyx_filename = NULL;
14665 int __pyx_clineno = 0;
14666 PyObject *__pyx_r = 0;
14667 __Pyx_RefNannyDeclarations
14668 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity (wrapper)", 0);
14670 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df,&__pyx_n_s_characteristic_velocity,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
14671 PyObject* values[4] = {0,0,0,0};
14672 if (unlikely(__pyx_kwds)) {
14673 Py_ssize_t kw_args;
14674 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14675 switch (pos_args) {
14676 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14677 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14678 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14679 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14681 default:
goto __pyx_L5_argtuple_error;
14683 kw_args = PyDict_Size(__pyx_kwds);
14684 switch (pos_args) {
14686 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_df)) != 0)) kw_args--;
14687 else goto __pyx_L5_argtuple_error;
14689 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_characteristic_velocity)) != 0)) kw_args--;
14691 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14694 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
14696 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14699 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
14701 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14704 if (unlikely(kw_args > 0)) {
14705 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromElementVelocity") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14707 }
else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
14708 goto __pyx_L5_argtuple_error;
14710 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14711 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14712 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14713 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
14715 __pyx_v_df = ((PyArrayObject *)values[0]);
14716 __pyx_v_characteristic_velocity = ((PyArrayObject *)values[1]);
14717 __pyx_v_dm = ((PyArrayObject *)values[2]);
14718 __pyx_v_dV = ((PyArrayObject *)values[3]);
14720 goto __pyx_L4_argument_unpacking_done;
14721 __pyx_L5_argtuple_error:;
14722 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromElementVelocity", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
14724 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
14725 __Pyx_RefNannyFinishContext();
14727 __pyx_L4_argument_unpacking_done:;
14728 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df), __pyx_ptype_5numpy_ndarray, 1,
"df", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14729 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 733; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14730 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 734; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14731 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 735; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14732 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(__pyx_self, __pyx_v_df, __pyx_v_characteristic_velocity, __pyx_v_dm, __pyx_v_dV);
14739 __Pyx_RefNannyFinishContext();
14743 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_42computeSimpleCharacteristicVelocityFromElementVelocity(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df, PyArrayObject *__pyx_v_characteristic_velocity, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
14747 double __pyx_v_omega_e;
14748 double __pyx_v_vol_e;
14749 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity;
14750 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity;
14751 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
14752 __Pyx_Buffer __pyx_pybuffer_dV;
14753 __Pyx_LocalBuf_ND __pyx_pybuffernd_df;
14754 __Pyx_Buffer __pyx_pybuffer_df;
14755 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
14756 __Pyx_Buffer __pyx_pybuffer_dm;
14757 PyObject *__pyx_r = NULL;
14758 __Pyx_RefNannyDeclarations
14759 npy_intp __pyx_t_1;
14761 npy_intp __pyx_t_3;
14763 Py_ssize_t __pyx_t_5;
14764 Py_ssize_t __pyx_t_6;
14766 Py_ssize_t __pyx_t_8;
14767 Py_ssize_t __pyx_t_9;
14768 Py_ssize_t __pyx_t_10;
14769 Py_ssize_t __pyx_t_11;
14770 npy_intp __pyx_t_12;
14771 Py_ssize_t __pyx_t_13;
14772 Py_ssize_t __pyx_t_14;
14773 Py_ssize_t __pyx_t_15;
14775 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_17;
14777 Py_ssize_t __pyx_t_19;
14778 Py_ssize_t __pyx_t_20;
14779 Py_ssize_t __pyx_t_21;
14780 int __pyx_lineno = 0;
14781 const char *__pyx_filename = NULL;
14782 int __pyx_clineno = 0;
14783 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromElementVelocity", 0);
14784 __pyx_pybuffer_df.pybuffer.buf = NULL;
14785 __pyx_pybuffer_df.refcount = 0;
14786 __pyx_pybuffernd_df.data = NULL;
14787 __pyx_pybuffernd_df.rcbuffer = &__pyx_pybuffer_df;
14788 __pyx_pybuffer_characteristic_velocity.pybuffer.buf = NULL;
14789 __pyx_pybuffer_characteristic_velocity.refcount = 0;
14790 __pyx_pybuffernd_characteristic_velocity.data = NULL;
14791 __pyx_pybuffernd_characteristic_velocity.rcbuffer = &__pyx_pybuffer_characteristic_velocity;
14792 __pyx_pybuffer_dm.pybuffer.buf = NULL;
14793 __pyx_pybuffer_dm.refcount = 0;
14794 __pyx_pybuffernd_dm.data = NULL;
14795 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
14796 __pyx_pybuffer_dV.pybuffer.buf = NULL;
14797 __pyx_pybuffer_dV.refcount = 0;
14798 __pyx_pybuffernd_dV.data = NULL;
14799 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
14801 __Pyx_BufFmt_StackElem __pyx_stack[1];
14802 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df.rcbuffer->pybuffer, (PyObject*)__pyx_v_df, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14804 __pyx_pybuffernd_df.diminfo[0].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df.diminfo[0].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_df.diminfo[1].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_df.diminfo[1].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_df.diminfo[2].strides = __pyx_pybuffernd_df.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_df.diminfo[2].shape = __pyx_pybuffernd_df.rcbuffer->pybuffer.shape[2];
14806 __Pyx_BufFmt_StackElem __pyx_stack[1];
14807 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14809 __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape = __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.shape[2];
14811 __Pyx_BufFmt_StackElem __pyx_stack[1];
14812 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14814 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
14816 __Pyx_BufFmt_StackElem __pyx_stack[1];
14817 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14819 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
14828 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
14829 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
14830 __pyx_v_eN = __pyx_t_2;
14839 __pyx_v_omega_e = 0.0;
14848 __pyx_v_vol_e = 0.0;
14857 __pyx_t_3 = (__pyx_v_dm->dimensions[1]);
14858 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14859 __pyx_v_k = __pyx_t_4;
14868 __pyx_t_5 = __pyx_v_eN;
14869 __pyx_t_6 = __pyx_v_k;
14871 if (__pyx_t_5 < 0) {
14872 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
14873 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
14874 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14875 if (__pyx_t_6 < 0) {
14876 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
14877 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
14878 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14879 if (unlikely(__pyx_t_7 != -1)) {
14880 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14881 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14883 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
14892 __pyx_t_8 = __pyx_v_eN;
14893 __pyx_t_9 = __pyx_v_k;
14895 if (__pyx_t_8 < 0) {
14896 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
14897 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
14898 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
14899 if (__pyx_t_9 < 0) {
14900 __pyx_t_9 += __pyx_pybuffernd_dV.diminfo[1].shape;
14901 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
14902 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
14903 if (unlikely(__pyx_t_7 != -1)) {
14904 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14905 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14907 __pyx_t_10 = __pyx_v_eN;
14908 __pyx_t_11 = __pyx_v_k;
14910 if (__pyx_t_10 < 0) {
14911 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
14912 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
14913 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_7 = 0;
14914 if (__pyx_t_11 < 0) {
14915 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
14916 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
14917 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_7 = 1;
14918 if (unlikely(__pyx_t_7 != -1)) {
14919 __Pyx_RaiseBufferIndexError(__pyx_t_7);
14920 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14922 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
14932 __pyx_t_3 = (__pyx_v_df->dimensions[1]);
14933 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
14934 __pyx_v_k = __pyx_t_4;
14943 __pyx_t_12 = (__pyx_v_df->dimensions[2]);
14944 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_12; __pyx_t_7+=1) {
14945 __pyx_v_I = __pyx_t_7;
14954 __pyx_t_13 = __pyx_v_eN;
14955 __pyx_t_14 = __pyx_v_k;
14956 __pyx_t_15 = __pyx_v_I;
14958 if (__pyx_t_13 < 0) {
14959 __pyx_t_13 += __pyx_pybuffernd_df.diminfo[0].shape;
14960 if (unlikely(__pyx_t_13 < 0)) __pyx_t_16 = 0;
14961 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_df.diminfo[0].shape)) __pyx_t_16 = 0;
14962 if (__pyx_t_14 < 0) {
14963 __pyx_t_14 += __pyx_pybuffernd_df.diminfo[1].shape;
14964 if (unlikely(__pyx_t_14 < 0)) __pyx_t_16 = 1;
14965 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_df.diminfo[1].shape)) __pyx_t_16 = 1;
14966 if (__pyx_t_15 < 0) {
14967 __pyx_t_15 += __pyx_pybuffernd_df.diminfo[2].shape;
14968 if (unlikely(__pyx_t_15 < 0)) __pyx_t_16 = 2;
14969 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_df.diminfo[2].shape)) __pyx_t_16 = 2;
14970 if (unlikely(__pyx_t_16 != -1)) {
14971 __Pyx_RaiseBufferIndexError(__pyx_t_16);
14972 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14974 __pyx_t_17 = ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_df.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_df.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_df.diminfo[2].strides)) * __pyx_v_vol_e);
14975 __pyx_t_18 = (__pyx_v_omega_e + 1.0e-12);
14976 if (unlikely(__pyx_t_18 == 0)) {
14977 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
14978 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
14980 __pyx_t_19 = __pyx_v_eN;
14981 __pyx_t_20 = __pyx_v_k;
14982 __pyx_t_21 = __pyx_v_I;
14984 if (__pyx_t_19 < 0) {
14985 __pyx_t_19 += __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape;
14986 if (unlikely(__pyx_t_19 < 0)) __pyx_t_16 = 0;
14987 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_characteristic_velocity.diminfo[0].shape)) __pyx_t_16 = 0;
14988 if (__pyx_t_20 < 0) {
14989 __pyx_t_20 += __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape;
14990 if (unlikely(__pyx_t_20 < 0)) __pyx_t_16 = 1;
14991 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_characteristic_velocity.diminfo[1].shape)) __pyx_t_16 = 1;
14992 if (__pyx_t_21 < 0) {
14993 __pyx_t_21 += __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape;
14994 if (unlikely(__pyx_t_21 < 0)) __pyx_t_16 = 2;
14995 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_characteristic_velocity.diminfo[2].shape)) __pyx_t_16 = 2;
14996 if (unlikely(__pyx_t_16 != -1)) {
14997 __Pyx_RaiseBufferIndexError(__pyx_t_16);
14998 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15000 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_characteristic_velocity.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_characteristic_velocity.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_characteristic_velocity.diminfo[2].strides) = (__pyx_t_17 / __pyx_t_18);
15014 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15017 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15018 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15019 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
15020 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15021 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
15022 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15023 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15024 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromElementVelocity", __pyx_clineno, __pyx_lineno, __pyx_filename);
15028 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity.rcbuffer->pybuffer);
15029 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15030 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df.rcbuffer->pybuffer);
15031 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15033 __Pyx_XGIVEREF(__pyx_r);
15034 __Pyx_RefNannyFinishContext();
15047 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15048 static char __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs[] =
"\n simple approximation for \\lambda = df/\010ar{dm} using \010ar{dm} = \014rac{1}{\\Omega_e} \\int_{\\Omega_e} dm dV\n ";
15049 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs = {
"computeSimpleCharacteristicVelocityFromVelocityDOFs", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, METH_VARARGS|METH_KEYWORDS, __pyx_doc_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs};
15050 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15051 PyArrayObject *__pyx_v_df_dofs = 0;
15052 PyArrayObject *__pyx_v_characteristic_velocity_dofs = 0;
15053 PyArrayObject *__pyx_v_l2g = 0;
15054 PyArrayObject *__pyx_v_dm = 0;
15055 PyArrayObject *__pyx_v_dV = 0;
15056 int __pyx_lineno = 0;
15057 const char *__pyx_filename = NULL;
15058 int __pyx_clineno = 0;
15059 PyObject *__pyx_r = 0;
15060 __Pyx_RefNannyDeclarations
15061 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs (wrapper)", 0);
15063 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_df_dofs,&__pyx_n_s_characteristic_velocity_dofs,&__pyx_n_s_l2g,&__pyx_n_s_dm,&__pyx_n_s_dV,0};
15064 PyObject* values[5] = {0,0,0,0,0};
15065 if (unlikely(__pyx_kwds)) {
15066 Py_ssize_t kw_args;
15067 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15068 switch (pos_args) {
15069 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15070 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15071 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15072 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15073 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15075 default:
goto __pyx_L5_argtuple_error;
15077 kw_args = PyDict_Size(__pyx_kwds);
15078 switch (pos_args) {
15080 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_df_dofs)) != 0)) kw_args--;
15081 else goto __pyx_L5_argtuple_error;
15083 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_characteristic_velocity_dofs)) != 0)) kw_args--;
15085 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15088 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_l2g)) != 0)) kw_args--;
15090 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15093 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dm)) != 0)) kw_args--;
15095 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15098 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_dV)) != 0)) kw_args--;
15100 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15103 if (unlikely(kw_args > 0)) {
15104 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"computeSimpleCharacteristicVelocityFromVelocityDOFs") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15106 }
else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
15107 goto __pyx_L5_argtuple_error;
15109 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15110 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15111 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15112 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15113 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15115 __pyx_v_df_dofs = ((PyArrayObject *)values[0]);
15116 __pyx_v_characteristic_velocity_dofs = ((PyArrayObject *)values[1]);
15117 __pyx_v_l2g = ((PyArrayObject *)values[2]);
15118 __pyx_v_dm = ((PyArrayObject *)values[3]);
15119 __pyx_v_dV = ((PyArrayObject *)values[4]);
15121 goto __pyx_L4_argument_unpacking_done;
15122 __pyx_L5_argtuple_error:;
15123 __Pyx_RaiseArgtupleInvalid(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15125 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
15126 __Pyx_RefNannyFinishContext();
15128 __pyx_L4_argument_unpacking_done:;
15129 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_df_dofs), __pyx_ptype_5numpy_ndarray, 1,
"df_dofs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15130 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_characteristic_velocity_dofs), __pyx_ptype_5numpy_ndarray, 1,
"characteristic_velocity_dofs", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15131 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_l2g), __pyx_ptype_5numpy_ndarray, 1,
"l2g", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15132 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dm), __pyx_ptype_5numpy_ndarray, 1,
"dm", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 756; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15133 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_dV), __pyx_ptype_5numpy_ndarray, 1,
"dV", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15134 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(__pyx_self, __pyx_v_df_dofs, __pyx_v_characteristic_velocity_dofs, __pyx_v_l2g, __pyx_v_dm, __pyx_v_dV);
15141 __Pyx_RefNannyFinishContext();
15145 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_44computeSimpleCharacteristicVelocityFromVelocityDOFs(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_df_dofs, PyArrayObject *__pyx_v_characteristic_velocity_dofs, PyArrayObject *__pyx_v_l2g, PyArrayObject *__pyx_v_dm, PyArrayObject *__pyx_v_dV) {
15150 double __pyx_v_omega_e;
15151 double __pyx_v_vol_e;
15152 __Pyx_LocalBuf_ND __pyx_pybuffernd_characteristic_velocity_dofs;
15153 __Pyx_Buffer __pyx_pybuffer_characteristic_velocity_dofs;
15154 __Pyx_LocalBuf_ND __pyx_pybuffernd_dV;
15155 __Pyx_Buffer __pyx_pybuffer_dV;
15156 __Pyx_LocalBuf_ND __pyx_pybuffernd_df_dofs;
15157 __Pyx_Buffer __pyx_pybuffer_df_dofs;
15158 __Pyx_LocalBuf_ND __pyx_pybuffernd_dm;
15159 __Pyx_Buffer __pyx_pybuffer_dm;
15160 __Pyx_LocalBuf_ND __pyx_pybuffernd_l2g;
15161 __Pyx_Buffer __pyx_pybuffer_l2g;
15162 PyObject *__pyx_r = NULL;
15163 __Pyx_RefNannyDeclarations
15164 npy_intp __pyx_t_1;
15166 npy_intp __pyx_t_3;
15168 Py_ssize_t __pyx_t_5;
15169 Py_ssize_t __pyx_t_6;
15171 Py_ssize_t __pyx_t_8;
15172 Py_ssize_t __pyx_t_9;
15173 Py_ssize_t __pyx_t_10;
15174 Py_ssize_t __pyx_t_11;
15175 Py_ssize_t __pyx_t_12;
15176 Py_ssize_t __pyx_t_13;
15177 Py_ssize_t __pyx_t_14;
15178 __pyx_t_28subsurfaceTransportFunctions_DTYPE_t __pyx_t_15;
15180 Py_ssize_t __pyx_t_17;
15181 int __pyx_lineno = 0;
15182 const char *__pyx_filename = NULL;
15183 int __pyx_clineno = 0;
15184 __Pyx_RefNannySetupContext(
"computeSimpleCharacteristicVelocityFromVelocityDOFs", 0);
15185 __pyx_pybuffer_df_dofs.pybuffer.buf = NULL;
15186 __pyx_pybuffer_df_dofs.refcount = 0;
15187 __pyx_pybuffernd_df_dofs.data = NULL;
15188 __pyx_pybuffernd_df_dofs.rcbuffer = &__pyx_pybuffer_df_dofs;
15189 __pyx_pybuffer_characteristic_velocity_dofs.pybuffer.buf = NULL;
15190 __pyx_pybuffer_characteristic_velocity_dofs.refcount = 0;
15191 __pyx_pybuffernd_characteristic_velocity_dofs.data = NULL;
15192 __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer = &__pyx_pybuffer_characteristic_velocity_dofs;
15193 __pyx_pybuffer_l2g.pybuffer.buf = NULL;
15194 __pyx_pybuffer_l2g.refcount = 0;
15195 __pyx_pybuffernd_l2g.data = NULL;
15196 __pyx_pybuffernd_l2g.rcbuffer = &__pyx_pybuffer_l2g;
15197 __pyx_pybuffer_dm.pybuffer.buf = NULL;
15198 __pyx_pybuffer_dm.refcount = 0;
15199 __pyx_pybuffernd_dm.data = NULL;
15200 __pyx_pybuffernd_dm.rcbuffer = &__pyx_pybuffer_dm;
15201 __pyx_pybuffer_dV.pybuffer.buf = NULL;
15202 __pyx_pybuffer_dV.refcount = 0;
15203 __pyx_pybuffernd_dV.data = NULL;
15204 __pyx_pybuffernd_dV.rcbuffer = &__pyx_pybuffer_dV;
15206 __Pyx_BufFmt_StackElem __pyx_stack[1];
15207 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_df_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15209 __pyx_pybuffernd_df_dofs.diminfo[0].strides = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_df_dofs.diminfo[0].shape = __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.shape[0];
15211 __Pyx_BufFmt_StackElem __pyx_stack[1];
15212 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer, (PyObject*)__pyx_v_characteristic_velocity_dofs, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 1, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15214 __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape = __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.shape[0];
15216 __Pyx_BufFmt_StackElem __pyx_stack[1];
15217 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer, (PyObject*)__pyx_v_l2g, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_ITYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15219 __pyx_pybuffernd_l2g.diminfo[0].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_l2g.diminfo[0].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_l2g.diminfo[1].strides = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_l2g.diminfo[1].shape = __pyx_pybuffernd_l2g.rcbuffer->pybuffer.shape[1];
15221 __Pyx_BufFmt_StackElem __pyx_stack[1];
15222 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dm.rcbuffer->pybuffer, (PyObject*)__pyx_v_dm, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15224 __pyx_pybuffernd_dm.diminfo[0].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dm.diminfo[0].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dm.diminfo[1].strides = __pyx_pybuffernd_dm.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dm.diminfo[1].shape = __pyx_pybuffernd_dm.rcbuffer->pybuffer.shape[1];
15226 __Pyx_BufFmt_StackElem __pyx_stack[1];
15227 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_dV.rcbuffer->pybuffer, (PyObject*)__pyx_v_dV, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15229 __pyx_pybuffernd_dV.diminfo[0].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_dV.diminfo[0].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_dV.diminfo[1].strides = __pyx_pybuffernd_dV.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_dV.diminfo[1].shape = __pyx_pybuffernd_dV.rcbuffer->pybuffer.shape[1];
15238 __pyx_t_1 = (__pyx_v_dm->dimensions[0]);
15239 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
15240 __pyx_v_eN = __pyx_t_2;
15249 __pyx_v_omega_e = 0.0;
15258 __pyx_v_vol_e = 0.0;
15267 __pyx_t_3 = (__pyx_v_dm->dimensions[1]);
15268 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15269 __pyx_v_k = __pyx_t_4;
15278 __pyx_t_5 = __pyx_v_eN;
15279 __pyx_t_6 = __pyx_v_k;
15281 if (__pyx_t_5 < 0) {
15282 __pyx_t_5 += __pyx_pybuffernd_dV.diminfo[0].shape;
15283 if (unlikely(__pyx_t_5 < 0)) __pyx_t_7 = 0;
15284 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
15285 if (__pyx_t_6 < 0) {
15286 __pyx_t_6 += __pyx_pybuffernd_dV.diminfo[1].shape;
15287 if (unlikely(__pyx_t_6 < 0)) __pyx_t_7 = 1;
15288 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
15289 if (unlikely(__pyx_t_7 != -1)) {
15290 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15291 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 769; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15293 __pyx_v_vol_e = (__pyx_v_vol_e + (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_dV.diminfo[1].strides)));
15302 __pyx_t_8 = __pyx_v_eN;
15303 __pyx_t_9 = __pyx_v_k;
15305 if (__pyx_t_8 < 0) {
15306 __pyx_t_8 += __pyx_pybuffernd_dV.diminfo[0].shape;
15307 if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
15308 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_dV.diminfo[0].shape)) __pyx_t_7 = 0;
15309 if (__pyx_t_9 < 0) {
15310 __pyx_t_9 += __pyx_pybuffernd_dV.diminfo[1].shape;
15311 if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 1;
15312 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_dV.diminfo[1].shape)) __pyx_t_7 = 1;
15313 if (unlikely(__pyx_t_7 != -1)) {
15314 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15315 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15317 __pyx_t_10 = __pyx_v_eN;
15318 __pyx_t_11 = __pyx_v_k;
15320 if (__pyx_t_10 < 0) {
15321 __pyx_t_10 += __pyx_pybuffernd_dm.diminfo[0].shape;
15322 if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
15323 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_dm.diminfo[0].shape)) __pyx_t_7 = 0;
15324 if (__pyx_t_11 < 0) {
15325 __pyx_t_11 += __pyx_pybuffernd_dm.diminfo[1].shape;
15326 if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 1;
15327 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_dm.diminfo[1].shape)) __pyx_t_7 = 1;
15328 if (unlikely(__pyx_t_7 != -1)) {
15329 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15330 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 770; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15332 __pyx_v_omega_e = (__pyx_v_omega_e + ((*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dV.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_dV.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_dV.diminfo[1].strides)) * (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_dm.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_dm.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_dm.diminfo[1].strides))));
15342 __pyx_t_3 = (__pyx_v_l2g->dimensions[1]);
15343 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
15344 __pyx_v_j = __pyx_t_4;
15353 __pyx_t_12 = __pyx_v_eN;
15354 __pyx_t_13 = __pyx_v_j;
15356 if (__pyx_t_12 < 0) {
15357 __pyx_t_12 += __pyx_pybuffernd_l2g.diminfo[0].shape;
15358 if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
15359 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_l2g.diminfo[0].shape)) __pyx_t_7 = 0;
15360 if (__pyx_t_13 < 0) {
15361 __pyx_t_13 += __pyx_pybuffernd_l2g.diminfo[1].shape;
15362 if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 1;
15363 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_l2g.diminfo[1].shape)) __pyx_t_7 = 1;
15364 if (unlikely(__pyx_t_7 != -1)) {
15365 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15366 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15368 __pyx_v_J = (*__Pyx_BufPtrStrided2d(__pyx_t_28subsurfaceTransportFunctions_ITYPE_t *, __pyx_pybuffernd_l2g.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_l2g.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_l2g.diminfo[1].strides));
15377 __pyx_t_14 = __pyx_v_J;
15379 if (__pyx_t_14 < 0) {
15380 __pyx_t_14 += __pyx_pybuffernd_df_dofs.diminfo[0].shape;
15381 if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
15382 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_df_dofs.diminfo[0].shape)) __pyx_t_7 = 0;
15383 if (unlikely(__pyx_t_7 != -1)) {
15384 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15385 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15387 __pyx_t_15 = ((*__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_df_dofs.rcbuffer->pybuffer.buf, __pyx_t_14, __pyx_pybuffernd_df_dofs.diminfo[0].strides)) * __pyx_v_vol_e);
15388 __pyx_t_16 = (__pyx_v_omega_e + 1.0e-12);
15389 if (unlikely(__pyx_t_16 == 0)) {
15390 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15391 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15393 __pyx_t_17 = __pyx_v_J;
15395 if (__pyx_t_17 < 0) {
15396 __pyx_t_17 += __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape;
15397 if (unlikely(__pyx_t_17 < 0)) __pyx_t_7 = 0;
15398 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].shape)) __pyx_t_7 = 0;
15399 if (unlikely(__pyx_t_7 != -1)) {
15400 __Pyx_RaiseBufferIndexError(__pyx_t_7);
15401 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 773; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15403 *__Pyx_BufPtrStrided1d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_characteristic_velocity_dofs.diminfo[0].strides) = (__pyx_t_15 / __pyx_t_16);
15416 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
15419 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
15420 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
15421 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
15422 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15423 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
15424 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15425 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
15426 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
15427 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.computeSimpleCharacteristicVelocityFromVelocityDOFs", __pyx_clineno, __pyx_lineno, __pyx_filename);
15431 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_characteristic_velocity_dofs.rcbuffer->pybuffer);
15432 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dV.rcbuffer->pybuffer);
15433 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_df_dofs.rcbuffer->pybuffer);
15434 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_dm.rcbuffer->pybuffer);
15435 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_l2g.rcbuffer->pybuffer);
15437 __Pyx_XGIVEREF(__pyx_r);
15438 __Pyx_RefNannyFinishContext();
15451 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
15452 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3 = {
"rotatingGaussianElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
15453 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
15454 int __pyx_v_transient;
15456 double __pyx_v_tForReversal;
15457 double __pyx_v_clock;
15460 PyArrayObject *__pyx_v_x = 0;
15461 PyArrayObject *__pyx_v_v = 0;
15462 double __pyx_v_zvelocity;
15463 int __pyx_lineno = 0;
15464 const char *__pyx_filename = NULL;
15465 int __pyx_clineno = 0;
15466 PyObject *__pyx_r = 0;
15467 __Pyx_RefNannyDeclarations
15468 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3 (wrapper)", 0);
15470 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
15471 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
15472 if (unlikely(__pyx_kwds)) {
15473 Py_ssize_t kw_args;
15474 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
15475 switch (pos_args) {
15476 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15477 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15478 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15479 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15480 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15481 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15482 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15483 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15484 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15486 default:
goto __pyx_L5_argtuple_error;
15488 kw_args = PyDict_Size(__pyx_kwds);
15489 switch (pos_args) {
15491 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
15492 else goto __pyx_L5_argtuple_error;
15494 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
15496 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15499 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
15501 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15504 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
15506 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15509 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
15511 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15514 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
15516 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15519 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
15521 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15524 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
15526 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15530 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zvelocity);
15531 if (value) { values[8] = value; kw_args--; }
15534 if (unlikely(kw_args > 0)) {
15535 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15538 switch (PyTuple_GET_SIZE(__pyx_args)) {
15539 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
15540 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
15541 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
15542 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
15543 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
15544 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
15545 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
15546 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
15547 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
15549 default:
goto __pyx_L5_argtuple_error;
15552 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15553 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 777; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15554 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 778; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15555 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 779; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15556 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15557 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15558 __pyx_v_x = ((PyArrayObject *)values[6]);
15559 __pyx_v_v = ((PyArrayObject *)values[7]);
15561 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 783; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15563 __pyx_v_zvelocity = ((double)0.0);
15566 goto __pyx_L4_argument_unpacking_done;
15567 __pyx_L5_argtuple_error:;
15568 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval3", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
15570 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
15571 __Pyx_RefNannyFinishContext();
15573 __pyx_L4_argument_unpacking_done:;
15574 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 781; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15575 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 782; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15576 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
15583 __Pyx_RefNannyFinishContext();
15587 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_46rotatingGaussianElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
15591 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
15592 __Pyx_Buffer __pyx_pybuffer_v;
15593 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
15594 __Pyx_Buffer __pyx_pybuffer_x;
15595 PyObject *__pyx_r = NULL;
15596 __Pyx_RefNannyDeclarations
15598 npy_intp __pyx_t_2;
15600 npy_intp __pyx_t_4;
15602 Py_ssize_t __pyx_t_6;
15603 Py_ssize_t __pyx_t_7;
15604 Py_ssize_t __pyx_t_8;
15606 Py_ssize_t __pyx_t_10;
15607 Py_ssize_t __pyx_t_11;
15608 Py_ssize_t __pyx_t_12;
15609 Py_ssize_t __pyx_t_13;
15610 Py_ssize_t __pyx_t_14;
15611 Py_ssize_t __pyx_t_15;
15612 Py_ssize_t __pyx_t_16;
15613 Py_ssize_t __pyx_t_17;
15614 Py_ssize_t __pyx_t_18;
15615 Py_ssize_t __pyx_t_19;
15616 Py_ssize_t __pyx_t_20;
15617 Py_ssize_t __pyx_t_21;
15618 PyObject *__pyx_t_22 = NULL;
15619 PyObject *__pyx_t_23 = NULL;
15620 PyObject *__pyx_t_24 = NULL;
15623 PyObject *__pyx_t_27 = NULL;
15624 Py_ssize_t __pyx_t_28;
15625 Py_ssize_t __pyx_t_29;
15626 Py_ssize_t __pyx_t_30;
15627 Py_ssize_t __pyx_t_31;
15628 Py_ssize_t __pyx_t_32;
15629 Py_ssize_t __pyx_t_33;
15630 Py_ssize_t __pyx_t_34;
15631 Py_ssize_t __pyx_t_35;
15632 Py_ssize_t __pyx_t_36;
15633 Py_ssize_t __pyx_t_37;
15634 Py_ssize_t __pyx_t_38;
15635 Py_ssize_t __pyx_t_39;
15636 Py_ssize_t __pyx_t_40;
15637 Py_ssize_t __pyx_t_41;
15638 Py_ssize_t __pyx_t_42;
15639 Py_ssize_t __pyx_t_43;
15640 Py_ssize_t __pyx_t_44;
15641 Py_ssize_t __pyx_t_45;
15642 Py_ssize_t __pyx_t_46;
15643 Py_ssize_t __pyx_t_47;
15644 Py_ssize_t __pyx_t_48;
15645 Py_ssize_t __pyx_t_49;
15646 Py_ssize_t __pyx_t_50;
15647 Py_ssize_t __pyx_t_51;
15648 Py_ssize_t __pyx_t_52;
15649 Py_ssize_t __pyx_t_53;
15650 Py_ssize_t __pyx_t_54;
15651 Py_ssize_t __pyx_t_55;
15652 Py_ssize_t __pyx_t_56;
15653 Py_ssize_t __pyx_t_57;
15654 Py_ssize_t __pyx_t_58;
15655 Py_ssize_t __pyx_t_59;
15656 Py_ssize_t __pyx_t_60;
15657 Py_ssize_t __pyx_t_61;
15658 Py_ssize_t __pyx_t_62;
15659 Py_ssize_t __pyx_t_63;
15660 Py_ssize_t __pyx_t_64;
15661 Py_ssize_t __pyx_t_65;
15662 Py_ssize_t __pyx_t_66;
15663 int __pyx_lineno = 0;
15664 const char *__pyx_filename = NULL;
15665 int __pyx_clineno = 0;
15666 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval3", 0);
15667 __pyx_pybuffer_x.pybuffer.buf = NULL;
15668 __pyx_pybuffer_x.refcount = 0;
15669 __pyx_pybuffernd_x.data = NULL;
15670 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
15671 __pyx_pybuffer_v.pybuffer.buf = NULL;
15672 __pyx_pybuffer_v.refcount = 0;
15673 __pyx_pybuffernd_v.data = NULL;
15674 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
15676 __Pyx_BufFmt_StackElem __pyx_stack[1];
15677 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15679 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
15681 __Pyx_BufFmt_StackElem __pyx_stack[1];
15682 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15684 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
15702 __pyx_t_1 = (((__pyx_v_v->dimensions[2]) == 3) != 0);
15712 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
15722 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
15723 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15724 __pyx_v_eN = __pyx_t_3;
15733 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
15734 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15735 __pyx_v_k = __pyx_t_5;
15744 __pyx_t_6 = __pyx_v_eN;
15745 __pyx_t_7 = __pyx_v_k;
15748 if (__pyx_t_6 < 0) {
15749 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[0].shape;
15750 if (unlikely(__pyx_t_6 < 0)) __pyx_t_9 = 0;
15751 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
15752 if (__pyx_t_7 < 0) {
15753 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[1].shape;
15754 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
15755 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
15756 if (__pyx_t_8 < 0) {
15757 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
15758 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
15759 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
15760 if (unlikely(__pyx_t_9 != -1)) {
15761 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15762 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15764 __pyx_t_10 = __pyx_v_eN;
15765 __pyx_t_11 = __pyx_v_k;
15768 if (__pyx_t_10 < 0) {
15769 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
15770 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
15771 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
15772 if (__pyx_t_11 < 0) {
15773 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[1].shape;
15774 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
15775 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
15776 if (__pyx_t_12 < 0) {
15777 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
15778 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 2;
15779 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
15780 if (unlikely(__pyx_t_9 != -1)) {
15781 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15782 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 791; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15784 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
15793 __pyx_t_13 = __pyx_v_eN;
15794 __pyx_t_14 = __pyx_v_k;
15797 if (__pyx_t_13 < 0) {
15798 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
15799 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
15800 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
15801 if (__pyx_t_14 < 0) {
15802 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[1].shape;
15803 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
15804 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
15805 if (__pyx_t_15 < 0) {
15806 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[2].shape;
15807 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 2;
15808 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
15809 if (unlikely(__pyx_t_9 != -1)) {
15810 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15811 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15813 __pyx_t_16 = __pyx_v_eN;
15814 __pyx_t_17 = __pyx_v_k;
15817 if (__pyx_t_16 < 0) {
15818 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
15819 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
15820 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
15821 if (__pyx_t_17 < 0) {
15822 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
15823 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
15824 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
15825 if (__pyx_t_18 < 0) {
15826 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
15827 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
15828 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
15829 if (unlikely(__pyx_t_9 != -1)) {
15830 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15831 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 792; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15833 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[2].strides))));
15842 __pyx_t_19 = __pyx_v_eN;
15843 __pyx_t_20 = __pyx_v_k;
15846 if (__pyx_t_19 < 0) {
15847 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
15848 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
15849 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
15850 if (__pyx_t_20 < 0) {
15851 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[1].shape;
15852 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
15853 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
15854 if (__pyx_t_21 < 0) {
15855 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[2].shape;
15856 if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 2;
15857 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
15858 if (unlikely(__pyx_t_9 != -1)) {
15859 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15860 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 793; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15862 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
15871 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15872 __Pyx_GOTREF(__pyx_t_22);
15873 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15874 __Pyx_GOTREF(__pyx_t_23);
15875 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15876 __Pyx_GOTREF(__pyx_t_24);
15877 __Pyx_GIVEREF(__pyx_t_22);
15878 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22);
15879 __Pyx_GIVEREF(__pyx_t_23);
15880 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
15881 __Pyx_INCREF(__pyx_slice__3);
15882 __Pyx_GIVEREF(__pyx_slice__3);
15883 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice__3);
15886 __pyx_t_23 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(__pyx_t_23 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
15887 __Pyx_GOTREF(__pyx_t_23);
15888 __pyx_t_25 = (__pyx_v_tForReversal - __pyx_v_t);
15889 __pyx_t_26 = (__pyx_v_tForReversal - 0.0);
15890 if (unlikely(__pyx_t_26 == 0)) {
15891 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
15892 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15894 __pyx_t_22 = PyFloat_FromDouble(((__pyx_t_25 / __pyx_t_26) * __pyx_v_clock));
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15895 __Pyx_GOTREF(__pyx_t_22);
15896 __pyx_t_27 = PyNumber_InPlaceMultiply(__pyx_t_23, __pyx_t_22);
if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15897 __Pyx_GOTREF(__pyx_t_27);
15898 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
15899 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
15900 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_27) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15901 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
15902 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
15924 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
15925 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
15926 __pyx_v_eN = __pyx_t_3;
15935 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
15936 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
15937 __pyx_v_k = __pyx_t_5;
15946 __pyx_t_28 = __pyx_v_eN;
15947 __pyx_t_29 = __pyx_v_k;
15950 if (__pyx_t_28 < 0) {
15951 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
15952 if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
15953 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
15954 if (__pyx_t_29 < 0) {
15955 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
15956 if (unlikely(__pyx_t_29 < 0)) __pyx_t_9 = 1;
15957 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
15958 if (__pyx_t_30 < 0) {
15959 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
15960 if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 2;
15961 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
15962 if (unlikely(__pyx_t_9 != -1)) {
15963 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15964 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15966 __pyx_t_31 = __pyx_v_eN;
15967 __pyx_t_32 = __pyx_v_k;
15970 if (__pyx_t_31 < 0) {
15971 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[0].shape;
15972 if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
15973 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
15974 if (__pyx_t_32 < 0) {
15975 __pyx_t_32 += __pyx_pybuffernd_v.diminfo[1].shape;
15976 if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 1;
15977 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
15978 if (__pyx_t_33 < 0) {
15979 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[2].shape;
15980 if (unlikely(__pyx_t_33 < 0)) __pyx_t_9 = 2;
15981 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
15982 if (unlikely(__pyx_t_9 != -1)) {
15983 __Pyx_RaiseBufferIndexError(__pyx_t_9);
15984 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 798; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
15986 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
15995 __pyx_t_34 = __pyx_v_eN;
15996 __pyx_t_35 = __pyx_v_k;
15999 if (__pyx_t_34 < 0) {
16000 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[0].shape;
16001 if (unlikely(__pyx_t_34 < 0)) __pyx_t_9 = 0;
16002 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16003 if (__pyx_t_35 < 0) {
16004 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[1].shape;
16005 if (unlikely(__pyx_t_35 < 0)) __pyx_t_9 = 1;
16006 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16007 if (__pyx_t_36 < 0) {
16008 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[2].shape;
16009 if (unlikely(__pyx_t_36 < 0)) __pyx_t_9 = 2;
16010 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16011 if (unlikely(__pyx_t_9 != -1)) {
16012 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16013 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16015 __pyx_t_37 = __pyx_v_eN;
16016 __pyx_t_38 = __pyx_v_k;
16019 if (__pyx_t_37 < 0) {
16020 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[0].shape;
16021 if (unlikely(__pyx_t_37 < 0)) __pyx_t_9 = 0;
16022 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16023 if (__pyx_t_38 < 0) {
16024 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[1].shape;
16025 if (unlikely(__pyx_t_38 < 0)) __pyx_t_9 = 1;
16026 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16027 if (__pyx_t_39 < 0) {
16028 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[2].shape;
16029 if (unlikely(__pyx_t_39 < 0)) __pyx_t_9 = 2;
16030 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16031 if (unlikely(__pyx_t_9 != -1)) {
16032 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16033 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16035 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[2].strides))));
16044 __pyx_t_40 = __pyx_v_eN;
16045 __pyx_t_41 = __pyx_v_k;
16048 if (__pyx_t_40 < 0) {
16049 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[0].shape;
16050 if (unlikely(__pyx_t_40 < 0)) __pyx_t_9 = 0;
16051 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16052 if (__pyx_t_41 < 0) {
16053 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[1].shape;
16054 if (unlikely(__pyx_t_41 < 0)) __pyx_t_9 = 1;
16055 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16056 if (__pyx_t_42 < 0) {
16057 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[2].shape;
16058 if (unlikely(__pyx_t_42 < 0)) __pyx_t_9 = 2;
16059 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16060 if (unlikely(__pyx_t_9 != -1)) {
16061 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16062 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 800; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16064 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zvelocity;
16088 #ifndef CYTHON_WITHOUT_ASSERTIONS
16089 if (unlikely(!Py_OptimizeFlag)) {
16090 if (unlikely(!(((__pyx_v_v->dimensions[2]) == 2) != 0))) {
16091 PyErr_SetNone(PyExc_AssertionError);
16092 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 802; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16104 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
16114 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16115 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16116 __pyx_v_eN = __pyx_t_3;
16125 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16126 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16127 __pyx_v_k = __pyx_t_5;
16136 __pyx_t_43 = __pyx_v_eN;
16137 __pyx_t_44 = __pyx_v_k;
16140 if (__pyx_t_43 < 0) {
16141 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
16142 if (unlikely(__pyx_t_43 < 0)) __pyx_t_9 = 0;
16143 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16144 if (__pyx_t_44 < 0) {
16145 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
16146 if (unlikely(__pyx_t_44 < 0)) __pyx_t_9 = 1;
16147 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16148 if (__pyx_t_45 < 0) {
16149 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
16150 if (unlikely(__pyx_t_45 < 0)) __pyx_t_9 = 2;
16151 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16152 if (unlikely(__pyx_t_9 != -1)) {
16153 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16154 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16156 __pyx_t_46 = __pyx_v_eN;
16157 __pyx_t_47 = __pyx_v_k;
16160 if (__pyx_t_46 < 0) {
16161 __pyx_t_46 += __pyx_pybuffernd_v.diminfo[0].shape;
16162 if (unlikely(__pyx_t_46 < 0)) __pyx_t_9 = 0;
16163 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16164 if (__pyx_t_47 < 0) {
16165 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[1].shape;
16166 if (unlikely(__pyx_t_47 < 0)) __pyx_t_9 = 1;
16167 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16168 if (__pyx_t_48 < 0) {
16169 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[2].shape;
16170 if (unlikely(__pyx_t_48 < 0)) __pyx_t_9 = 2;
16171 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16172 if (unlikely(__pyx_t_9 != -1)) {
16173 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16174 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 806; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16176 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_46, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_47, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
16185 __pyx_t_49 = __pyx_v_eN;
16186 __pyx_t_50 = __pyx_v_k;
16189 if (__pyx_t_49 < 0) {
16190 __pyx_t_49 += __pyx_pybuffernd_x.diminfo[0].shape;
16191 if (unlikely(__pyx_t_49 < 0)) __pyx_t_9 = 0;
16192 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16193 if (__pyx_t_50 < 0) {
16194 __pyx_t_50 += __pyx_pybuffernd_x.diminfo[1].shape;
16195 if (unlikely(__pyx_t_50 < 0)) __pyx_t_9 = 1;
16196 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16197 if (__pyx_t_51 < 0) {
16198 __pyx_t_51 += __pyx_pybuffernd_x.diminfo[2].shape;
16199 if (unlikely(__pyx_t_51 < 0)) __pyx_t_9 = 2;
16200 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16201 if (unlikely(__pyx_t_9 != -1)) {
16202 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16203 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16205 __pyx_t_52 = __pyx_v_eN;
16206 __pyx_t_53 = __pyx_v_k;
16209 if (__pyx_t_52 < 0) {
16210 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[0].shape;
16211 if (unlikely(__pyx_t_52 < 0)) __pyx_t_9 = 0;
16212 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16213 if (__pyx_t_53 < 0) {
16214 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[1].shape;
16215 if (unlikely(__pyx_t_53 < 0)) __pyx_t_9 = 1;
16216 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16217 if (__pyx_t_54 < 0) {
16218 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[2].shape;
16219 if (unlikely(__pyx_t_54 < 0)) __pyx_t_9 = 2;
16220 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16221 if (unlikely(__pyx_t_9 != -1)) {
16222 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16223 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16225 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_52, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_49, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_50, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_51, __pyx_pybuffernd_x.diminfo[2].strides))));
16234 __pyx_t_24 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16235 __Pyx_GOTREF(__pyx_t_24);
16236 __pyx_t_27 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16237 __Pyx_GOTREF(__pyx_t_27);
16238 __pyx_t_22 = PyTuple_New(3);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16239 __Pyx_GOTREF(__pyx_t_22);
16240 __Pyx_GIVEREF(__pyx_t_24);
16241 PyTuple_SET_ITEM(__pyx_t_22, 0, __pyx_t_24);
16242 __Pyx_GIVEREF(__pyx_t_27);
16243 PyTuple_SET_ITEM(__pyx_t_22, 1, __pyx_t_27);
16244 __Pyx_INCREF(__pyx_slice__4);
16245 __Pyx_GIVEREF(__pyx_slice__4);
16246 PyTuple_SET_ITEM(__pyx_t_22, 2, __pyx_slice__4);
16249 __pyx_t_27 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_22);
if (unlikely(__pyx_t_27 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
16250 __Pyx_GOTREF(__pyx_t_27);
16251 __pyx_t_26 = (__pyx_v_tForReversal - __pyx_v_t);
16252 __pyx_t_25 = (__pyx_v_tForReversal - 0.0);
16253 if (unlikely(__pyx_t_25 == 0)) {
16254 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16255 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16257 __pyx_t_24 = PyFloat_FromDouble(((__pyx_t_26 / __pyx_t_25) * __pyx_v_clock));
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16258 __Pyx_GOTREF(__pyx_t_24);
16259 __pyx_t_23 = PyNumber_InPlaceMultiply(__pyx_t_27, __pyx_t_24);
if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16260 __Pyx_GOTREF(__pyx_t_23);
16261 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
16262 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
16263 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_22, __pyx_t_23) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16264 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
16265 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
16287 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16288 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16289 __pyx_v_eN = __pyx_t_3;
16298 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16299 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16300 __pyx_v_k = __pyx_t_5;
16309 __pyx_t_55 = __pyx_v_eN;
16310 __pyx_t_56 = __pyx_v_k;
16313 if (__pyx_t_55 < 0) {
16314 __pyx_t_55 += __pyx_pybuffernd_x.diminfo[0].shape;
16315 if (unlikely(__pyx_t_55 < 0)) __pyx_t_9 = 0;
16316 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16317 if (__pyx_t_56 < 0) {
16318 __pyx_t_56 += __pyx_pybuffernd_x.diminfo[1].shape;
16319 if (unlikely(__pyx_t_56 < 0)) __pyx_t_9 = 1;
16320 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16321 if (__pyx_t_57 < 0) {
16322 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[2].shape;
16323 if (unlikely(__pyx_t_57 < 0)) __pyx_t_9 = 2;
16324 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16325 if (unlikely(__pyx_t_9 != -1)) {
16326 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16327 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16329 __pyx_t_58 = __pyx_v_eN;
16330 __pyx_t_59 = __pyx_v_k;
16333 if (__pyx_t_58 < 0) {
16334 __pyx_t_58 += __pyx_pybuffernd_v.diminfo[0].shape;
16335 if (unlikely(__pyx_t_58 < 0)) __pyx_t_9 = 0;
16336 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16337 if (__pyx_t_59 < 0) {
16338 __pyx_t_59 += __pyx_pybuffernd_v.diminfo[1].shape;
16339 if (unlikely(__pyx_t_59 < 0)) __pyx_t_9 = 1;
16340 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16341 if (__pyx_t_60 < 0) {
16342 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[2].shape;
16343 if (unlikely(__pyx_t_60 < 0)) __pyx_t_9 = 2;
16344 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16345 if (unlikely(__pyx_t_9 != -1)) {
16346 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16347 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 812; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16349 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_58, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_59, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_60, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
16358 __pyx_t_61 = __pyx_v_eN;
16359 __pyx_t_62 = __pyx_v_k;
16362 if (__pyx_t_61 < 0) {
16363 __pyx_t_61 += __pyx_pybuffernd_x.diminfo[0].shape;
16364 if (unlikely(__pyx_t_61 < 0)) __pyx_t_9 = 0;
16365 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
16366 if (__pyx_t_62 < 0) {
16367 __pyx_t_62 += __pyx_pybuffernd_x.diminfo[1].shape;
16368 if (unlikely(__pyx_t_62 < 0)) __pyx_t_9 = 1;
16369 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
16370 if (__pyx_t_63 < 0) {
16371 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[2].shape;
16372 if (unlikely(__pyx_t_63 < 0)) __pyx_t_9 = 2;
16373 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
16374 if (unlikely(__pyx_t_9 != -1)) {
16375 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16376 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16378 __pyx_t_64 = __pyx_v_eN;
16379 __pyx_t_65 = __pyx_v_k;
16382 if (__pyx_t_64 < 0) {
16383 __pyx_t_64 += __pyx_pybuffernd_v.diminfo[0].shape;
16384 if (unlikely(__pyx_t_64 < 0)) __pyx_t_9 = 0;
16385 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
16386 if (__pyx_t_65 < 0) {
16387 __pyx_t_65 += __pyx_pybuffernd_v.diminfo[1].shape;
16388 if (unlikely(__pyx_t_65 < 0)) __pyx_t_9 = 1;
16389 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
16390 if (__pyx_t_66 < 0) {
16391 __pyx_t_66 += __pyx_pybuffernd_v.diminfo[2].shape;
16392 if (unlikely(__pyx_t_66 < 0)) __pyx_t_9 = 2;
16393 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
16394 if (unlikely(__pyx_t_9 != -1)) {
16395 __Pyx_RaiseBufferIndexError(__pyx_t_9);
16396 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16398 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_64, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_65, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_66, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_61, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_62, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_63, __pyx_pybuffernd_x.diminfo[2].strides))));
16415 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16418 __Pyx_XDECREF(__pyx_t_22);
16419 __Pyx_XDECREF(__pyx_t_23);
16420 __Pyx_XDECREF(__pyx_t_24);
16421 __Pyx_XDECREF(__pyx_t_27);
16422 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
16423 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
16424 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16425 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
16426 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
16427 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
16431 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
16432 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
16434 __Pyx_XGIVEREF(__pyx_r);
16435 __Pyx_RefNannyFinishContext();
16448 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
16449 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4 = {
"rotatingGaussianElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
16450 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
16451 int __pyx_v_transient;
16453 double __pyx_v_tForReversal;
16454 double __pyx_v_clock;
16457 PyArrayObject *__pyx_v_x = 0;
16458 PyArrayObject *__pyx_v_v = 0;
16459 double __pyx_v_zvelocity;
16460 int __pyx_lineno = 0;
16461 const char *__pyx_filename = NULL;
16462 int __pyx_clineno = 0;
16463 PyObject *__pyx_r = 0;
16464 __Pyx_RefNannyDeclarations
16465 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4 (wrapper)", 0);
16467 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,&__pyx_n_s_zvelocity,0};
16468 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
16469 if (unlikely(__pyx_kwds)) {
16470 Py_ssize_t kw_args;
16471 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
16472 switch (pos_args) {
16473 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16474 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16475 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16476 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16477 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16478 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16479 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16480 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16481 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16483 default:
goto __pyx_L5_argtuple_error;
16485 kw_args = PyDict_Size(__pyx_kwds);
16486 switch (pos_args) {
16488 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
16489 else goto __pyx_L5_argtuple_error;
16491 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
16493 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16496 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
16498 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16501 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
16503 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16506 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
16508 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16511 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
16513 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16516 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
16518 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16521 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
16523 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16527 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zvelocity);
16528 if (value) { values[8] = value; kw_args--; }
16531 if (unlikely(kw_args > 0)) {
16532 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"rotatingGaussianElementVelocityEval4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16535 switch (PyTuple_GET_SIZE(__pyx_args)) {
16536 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
16537 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
16538 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
16539 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
16540 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
16541 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
16542 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
16543 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
16544 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
16546 default:
goto __pyx_L5_argtuple_error;
16549 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16550 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16551 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 818; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16552 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 819; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16553 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16554 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 820; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16555 __pyx_v_x = ((PyArrayObject *)values[6]);
16556 __pyx_v_v = ((PyArrayObject *)values[7]);
16558 __pyx_v_zvelocity = __pyx_PyFloat_AsDouble(values[8]);
if (unlikely((__pyx_v_zvelocity == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16560 __pyx_v_zvelocity = ((double)0.0);
16563 goto __pyx_L4_argument_unpacking_done;
16564 __pyx_L5_argtuple_error:;
16565 __Pyx_RaiseArgtupleInvalid(
"rotatingGaussianElementVelocityEval4", 0, 8, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
16567 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
16568 __Pyx_RefNannyFinishContext();
16570 __pyx_L4_argument_unpacking_done:;
16571 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 821; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16572 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16573 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v, __pyx_v_zvelocity);
16580 __Pyx_RefNannyFinishContext();
16584 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_48rotatingGaussianElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v,
double __pyx_v_zvelocity) {
16589 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
16590 __Pyx_Buffer __pyx_pybuffer_v;
16591 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
16592 __Pyx_Buffer __pyx_pybuffer_x;
16593 PyObject *__pyx_r = NULL;
16594 __Pyx_RefNannyDeclarations
16596 npy_intp __pyx_t_2;
16598 npy_intp __pyx_t_4;
16600 npy_intp __pyx_t_6;
16602 Py_ssize_t __pyx_t_8;
16603 Py_ssize_t __pyx_t_9;
16604 Py_ssize_t __pyx_t_10;
16605 Py_ssize_t __pyx_t_11;
16607 Py_ssize_t __pyx_t_13;
16608 Py_ssize_t __pyx_t_14;
16609 Py_ssize_t __pyx_t_15;
16610 Py_ssize_t __pyx_t_16;
16611 Py_ssize_t __pyx_t_17;
16612 Py_ssize_t __pyx_t_18;
16613 Py_ssize_t __pyx_t_19;
16614 Py_ssize_t __pyx_t_20;
16615 Py_ssize_t __pyx_t_21;
16616 Py_ssize_t __pyx_t_22;
16617 Py_ssize_t __pyx_t_23;
16618 Py_ssize_t __pyx_t_24;
16619 Py_ssize_t __pyx_t_25;
16620 Py_ssize_t __pyx_t_26;
16621 Py_ssize_t __pyx_t_27;
16622 Py_ssize_t __pyx_t_28;
16623 PyObject *__pyx_t_29 = NULL;
16624 PyObject *__pyx_t_30 = NULL;
16625 PyObject *__pyx_t_31 = NULL;
16626 PyObject *__pyx_t_32 = NULL;
16629 Py_ssize_t __pyx_t_35;
16630 Py_ssize_t __pyx_t_36;
16631 Py_ssize_t __pyx_t_37;
16632 Py_ssize_t __pyx_t_38;
16633 Py_ssize_t __pyx_t_39;
16634 Py_ssize_t __pyx_t_40;
16635 Py_ssize_t __pyx_t_41;
16636 Py_ssize_t __pyx_t_42;
16637 Py_ssize_t __pyx_t_43;
16638 Py_ssize_t __pyx_t_44;
16639 Py_ssize_t __pyx_t_45;
16640 Py_ssize_t __pyx_t_46;
16641 Py_ssize_t __pyx_t_47;
16642 Py_ssize_t __pyx_t_48;
16643 Py_ssize_t __pyx_t_49;
16644 Py_ssize_t __pyx_t_50;
16645 Py_ssize_t __pyx_t_51;
16646 Py_ssize_t __pyx_t_52;
16647 Py_ssize_t __pyx_t_53;
16648 Py_ssize_t __pyx_t_54;
16649 Py_ssize_t __pyx_t_55;
16650 Py_ssize_t __pyx_t_56;
16651 Py_ssize_t __pyx_t_57;
16652 Py_ssize_t __pyx_t_58;
16653 Py_ssize_t __pyx_t_59;
16654 Py_ssize_t __pyx_t_60;
16655 Py_ssize_t __pyx_t_61;
16656 Py_ssize_t __pyx_t_62;
16657 Py_ssize_t __pyx_t_63;
16658 Py_ssize_t __pyx_t_64;
16659 Py_ssize_t __pyx_t_65;
16660 Py_ssize_t __pyx_t_66;
16661 Py_ssize_t __pyx_t_67;
16662 Py_ssize_t __pyx_t_68;
16663 Py_ssize_t __pyx_t_69;
16664 Py_ssize_t __pyx_t_70;
16665 Py_ssize_t __pyx_t_71;
16666 Py_ssize_t __pyx_t_72;
16667 Py_ssize_t __pyx_t_73;
16668 Py_ssize_t __pyx_t_74;
16669 Py_ssize_t __pyx_t_75;
16670 Py_ssize_t __pyx_t_76;
16671 Py_ssize_t __pyx_t_77;
16672 Py_ssize_t __pyx_t_78;
16673 Py_ssize_t __pyx_t_79;
16674 Py_ssize_t __pyx_t_80;
16675 Py_ssize_t __pyx_t_81;
16676 Py_ssize_t __pyx_t_82;
16677 Py_ssize_t __pyx_t_83;
16678 Py_ssize_t __pyx_t_84;
16679 Py_ssize_t __pyx_t_85;
16680 Py_ssize_t __pyx_t_86;
16681 int __pyx_lineno = 0;
16682 const char *__pyx_filename = NULL;
16683 int __pyx_clineno = 0;
16684 __Pyx_RefNannySetupContext(
"rotatingGaussianElementVelocityEval4", 0);
16685 __pyx_pybuffer_x.pybuffer.buf = NULL;
16686 __pyx_pybuffer_x.refcount = 0;
16687 __pyx_pybuffernd_x.data = NULL;
16688 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
16689 __pyx_pybuffer_v.pybuffer.buf = NULL;
16690 __pyx_pybuffer_v.refcount = 0;
16691 __pyx_pybuffernd_v.data = NULL;
16692 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
16694 __Pyx_BufFmt_StackElem __pyx_stack[1];
16695 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16697 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
16699 __Pyx_BufFmt_StackElem __pyx_stack[1];
16700 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16702 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
16720 __pyx_t_1 = (((__pyx_v_v->dimensions[-1L]) == 3) != 0);
16730 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
16740 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16741 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16742 __pyx_v_eN = __pyx_t_3;
16751 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16752 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16753 __pyx_v_ebN = __pyx_t_5;
16762 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
16763 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
16764 __pyx_v_k = __pyx_t_7;
16773 __pyx_t_8 = __pyx_v_eN;
16774 __pyx_t_9 = __pyx_v_ebN;
16775 __pyx_t_10 = __pyx_v_k;
16778 if (__pyx_t_8 < 0) {
16779 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
16780 if (unlikely(__pyx_t_8 < 0)) __pyx_t_12 = 0;
16781 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
16782 if (__pyx_t_9 < 0) {
16783 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
16784 if (unlikely(__pyx_t_9 < 0)) __pyx_t_12 = 1;
16785 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
16786 if (__pyx_t_10 < 0) {
16787 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
16788 if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 2;
16789 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
16790 if (__pyx_t_11 < 0) {
16791 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
16792 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 3;
16793 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
16794 if (unlikely(__pyx_t_12 != -1)) {
16795 __Pyx_RaiseBufferIndexError(__pyx_t_12);
16796 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16798 __pyx_t_13 = __pyx_v_eN;
16799 __pyx_t_14 = __pyx_v_ebN;
16800 __pyx_t_15 = __pyx_v_k;
16803 if (__pyx_t_13 < 0) {
16804 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
16805 if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
16806 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
16807 if (__pyx_t_14 < 0) {
16808 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
16809 if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 1;
16810 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
16811 if (__pyx_t_15 < 0) {
16812 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
16813 if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 2;
16814 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
16815 if (__pyx_t_16 < 0) {
16816 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
16817 if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 3;
16818 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
16819 if (unlikely(__pyx_t_12 != -1)) {
16820 __Pyx_RaiseBufferIndexError(__pyx_t_12);
16821 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 832; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16823 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
16832 __pyx_t_17 = __pyx_v_eN;
16833 __pyx_t_18 = __pyx_v_ebN;
16834 __pyx_t_19 = __pyx_v_k;
16837 if (__pyx_t_17 < 0) {
16838 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape;
16839 if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0;
16840 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
16841 if (__pyx_t_18 < 0) {
16842 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[1].shape;
16843 if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 1;
16844 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
16845 if (__pyx_t_19 < 0) {
16846 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[2].shape;
16847 if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 2;
16848 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
16849 if (__pyx_t_20 < 0) {
16850 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[3].shape;
16851 if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 3;
16852 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
16853 if (unlikely(__pyx_t_12 != -1)) {
16854 __Pyx_RaiseBufferIndexError(__pyx_t_12);
16855 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16857 __pyx_t_21 = __pyx_v_eN;
16858 __pyx_t_22 = __pyx_v_ebN;
16859 __pyx_t_23 = __pyx_v_k;
16862 if (__pyx_t_21 < 0) {
16863 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
16864 if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0;
16865 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
16866 if (__pyx_t_22 < 0) {
16867 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
16868 if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 1;
16869 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
16870 if (__pyx_t_23 < 0) {
16871 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
16872 if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 2;
16873 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
16874 if (__pyx_t_24 < 0) {
16875 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[3].shape;
16876 if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 3;
16877 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
16878 if (unlikely(__pyx_t_12 != -1)) {
16879 __Pyx_RaiseBufferIndexError(__pyx_t_12);
16880 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16882 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[3].strides))));
16891 __pyx_t_25 = __pyx_v_eN;
16892 __pyx_t_26 = __pyx_v_ebN;
16893 __pyx_t_27 = __pyx_v_k;
16896 if (__pyx_t_25 < 0) {
16897 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[0].shape;
16898 if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0;
16899 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
16900 if (__pyx_t_26 < 0) {
16901 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[1].shape;
16902 if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 1;
16903 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
16904 if (__pyx_t_27 < 0) {
16905 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[2].shape;
16906 if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 2;
16907 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
16908 if (__pyx_t_28 < 0) {
16909 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[3].shape;
16910 if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 3;
16911 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
16912 if (unlikely(__pyx_t_12 != -1)) {
16913 __Pyx_RaiseBufferIndexError(__pyx_t_12);
16914 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 834; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16916 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
16925 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16926 __Pyx_GOTREF(__pyx_t_29);
16927 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16928 __Pyx_GOTREF(__pyx_t_30);
16929 __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16930 __Pyx_GOTREF(__pyx_t_31);
16931 __pyx_t_32 = PyTuple_New(4);
if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16932 __Pyx_GOTREF(__pyx_t_32);
16933 __Pyx_GIVEREF(__pyx_t_29);
16934 PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_29);
16935 __Pyx_GIVEREF(__pyx_t_30);
16936 PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_30);
16937 __Pyx_GIVEREF(__pyx_t_31);
16938 PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_t_31);
16939 __Pyx_INCREF(__pyx_slice__5);
16940 __Pyx_GIVEREF(__pyx_slice__5);
16941 PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_slice__5);
16945 __pyx_t_31 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_32);
if (unlikely(__pyx_t_31 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
16946 __Pyx_GOTREF(__pyx_t_31);
16947 __pyx_t_33 = (__pyx_v_tForReversal - __pyx_v_t);
16948 __pyx_t_34 = (__pyx_v_tForReversal - 0.0);
16949 if (unlikely(__pyx_t_34 == 0)) {
16950 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
16951 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16953 __pyx_t_30 = PyFloat_FromDouble(((__pyx_t_33 / __pyx_t_34) * __pyx_v_clock));
if (unlikely(!__pyx_t_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16954 __Pyx_GOTREF(__pyx_t_30);
16955 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_31, __pyx_t_30);
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16956 __Pyx_GOTREF(__pyx_t_29);
16957 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
16958 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
16959 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_32, __pyx_t_29) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
16960 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
16961 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
16984 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
16985 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
16986 __pyx_v_eN = __pyx_t_3;
16995 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
16996 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
16997 __pyx_v_ebN = __pyx_t_5;
17006 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17007 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17008 __pyx_v_k = __pyx_t_7;
17017 __pyx_t_35 = __pyx_v_eN;
17018 __pyx_t_36 = __pyx_v_ebN;
17019 __pyx_t_37 = __pyx_v_k;
17022 if (__pyx_t_35 < 0) {
17023 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
17024 if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0;
17025 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17026 if (__pyx_t_36 < 0) {
17027 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
17028 if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 1;
17029 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17030 if (__pyx_t_37 < 0) {
17031 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
17032 if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 2;
17033 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17034 if (__pyx_t_38 < 0) {
17035 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
17036 if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 3;
17037 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17038 if (unlikely(__pyx_t_12 != -1)) {
17039 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17040 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17042 __pyx_t_39 = __pyx_v_eN;
17043 __pyx_t_40 = __pyx_v_ebN;
17044 __pyx_t_41 = __pyx_v_k;
17047 if (__pyx_t_39 < 0) {
17048 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
17049 if (unlikely(__pyx_t_39 < 0)) __pyx_t_12 = 0;
17050 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17051 if (__pyx_t_40 < 0) {
17052 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
17053 if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 1;
17054 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17055 if (__pyx_t_41 < 0) {
17056 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
17057 if (unlikely(__pyx_t_41 < 0)) __pyx_t_12 = 2;
17058 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17059 if (__pyx_t_42 < 0) {
17060 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
17061 if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 3;
17062 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17063 if (unlikely(__pyx_t_12 != -1)) {
17064 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17065 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 840; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17067 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
17076 __pyx_t_43 = __pyx_v_eN;
17077 __pyx_t_44 = __pyx_v_ebN;
17078 __pyx_t_45 = __pyx_v_k;
17081 if (__pyx_t_43 < 0) {
17082 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
17083 if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0;
17084 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17085 if (__pyx_t_44 < 0) {
17086 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
17087 if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 1;
17088 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17089 if (__pyx_t_45 < 0) {
17090 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
17091 if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 2;
17092 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17093 if (__pyx_t_46 < 0) {
17094 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[3].shape;
17095 if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 3;
17096 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17097 if (unlikely(__pyx_t_12 != -1)) {
17098 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17099 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17101 __pyx_t_47 = __pyx_v_eN;
17102 __pyx_t_48 = __pyx_v_ebN;
17103 __pyx_t_49 = __pyx_v_k;
17106 if (__pyx_t_47 < 0) {
17107 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[0].shape;
17108 if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0;
17109 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17110 if (__pyx_t_48 < 0) {
17111 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[1].shape;
17112 if (unlikely(__pyx_t_48 < 0)) __pyx_t_12 = 1;
17113 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17114 if (__pyx_t_49 < 0) {
17115 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[2].shape;
17116 if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 2;
17117 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17118 if (__pyx_t_50 < 0) {
17119 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[3].shape;
17120 if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 3;
17121 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17122 if (unlikely(__pyx_t_12 != -1)) {
17123 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17124 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17126 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[3].strides))));
17135 __pyx_t_51 = __pyx_v_eN;
17136 __pyx_t_52 = __pyx_v_ebN;
17137 __pyx_t_53 = __pyx_v_k;
17140 if (__pyx_t_51 < 0) {
17141 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[0].shape;
17142 if (unlikely(__pyx_t_51 < 0)) __pyx_t_12 = 0;
17143 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17144 if (__pyx_t_52 < 0) {
17145 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[1].shape;
17146 if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 1;
17147 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17148 if (__pyx_t_53 < 0) {
17149 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[2].shape;
17150 if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 2;
17151 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17152 if (__pyx_t_54 < 0) {
17153 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[3].shape;
17154 if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 3;
17155 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17156 if (unlikely(__pyx_t_12 != -1)) {
17157 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17158 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 842; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17160 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zvelocity;
17185 #ifndef CYTHON_WITHOUT_ASSERTIONS
17186 if (unlikely(!Py_OptimizeFlag)) {
17187 if (unlikely(!(((__pyx_v_v->dimensions[-1L]) == 2) != 0))) {
17188 PyErr_SetNone(PyExc_AssertionError);
17189 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 844; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17201 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17211 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17212 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17213 __pyx_v_eN = __pyx_t_3;
17222 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17223 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17224 __pyx_v_ebN = __pyx_t_5;
17233 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17234 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17235 __pyx_v_k = __pyx_t_7;
17244 __pyx_t_55 = __pyx_v_eN;
17245 __pyx_t_56 = __pyx_v_ebN;
17246 __pyx_t_57 = __pyx_v_k;
17249 if (__pyx_t_55 < 0) {
17250 __pyx_t_55 += __pyx_pybuffernd_x.diminfo[0].shape;
17251 if (unlikely(__pyx_t_55 < 0)) __pyx_t_12 = 0;
17252 }
else if (unlikely(__pyx_t_55 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17253 if (__pyx_t_56 < 0) {
17254 __pyx_t_56 += __pyx_pybuffernd_x.diminfo[1].shape;
17255 if (unlikely(__pyx_t_56 < 0)) __pyx_t_12 = 1;
17256 }
else if (unlikely(__pyx_t_56 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17257 if (__pyx_t_57 < 0) {
17258 __pyx_t_57 += __pyx_pybuffernd_x.diminfo[2].shape;
17259 if (unlikely(__pyx_t_57 < 0)) __pyx_t_12 = 2;
17260 }
else if (unlikely(__pyx_t_57 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17261 if (__pyx_t_58 < 0) {
17262 __pyx_t_58 += __pyx_pybuffernd_x.diminfo[3].shape;
17263 if (unlikely(__pyx_t_58 < 0)) __pyx_t_12 = 3;
17264 }
else if (unlikely(__pyx_t_58 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17265 if (unlikely(__pyx_t_12 != -1)) {
17266 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17267 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17269 __pyx_t_59 = __pyx_v_eN;
17270 __pyx_t_60 = __pyx_v_ebN;
17271 __pyx_t_61 = __pyx_v_k;
17274 if (__pyx_t_59 < 0) {
17275 __pyx_t_59 += __pyx_pybuffernd_v.diminfo[0].shape;
17276 if (unlikely(__pyx_t_59 < 0)) __pyx_t_12 = 0;
17277 }
else if (unlikely(__pyx_t_59 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17278 if (__pyx_t_60 < 0) {
17279 __pyx_t_60 += __pyx_pybuffernd_v.diminfo[1].shape;
17280 if (unlikely(__pyx_t_60 < 0)) __pyx_t_12 = 1;
17281 }
else if (unlikely(__pyx_t_60 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17282 if (__pyx_t_61 < 0) {
17283 __pyx_t_61 += __pyx_pybuffernd_v.diminfo[2].shape;
17284 if (unlikely(__pyx_t_61 < 0)) __pyx_t_12 = 2;
17285 }
else if (unlikely(__pyx_t_61 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17286 if (__pyx_t_62 < 0) {
17287 __pyx_t_62 += __pyx_pybuffernd_v.diminfo[3].shape;
17288 if (unlikely(__pyx_t_62 < 0)) __pyx_t_12 = 3;
17289 }
else if (unlikely(__pyx_t_62 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17290 if (unlikely(__pyx_t_12 != -1)) {
17291 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17292 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 849; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17294 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_59, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_60, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_61, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_62, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_55, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_56, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_57, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_58, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
17303 __pyx_t_63 = __pyx_v_eN;
17304 __pyx_t_64 = __pyx_v_ebN;
17305 __pyx_t_65 = __pyx_v_k;
17308 if (__pyx_t_63 < 0) {
17309 __pyx_t_63 += __pyx_pybuffernd_x.diminfo[0].shape;
17310 if (unlikely(__pyx_t_63 < 0)) __pyx_t_12 = 0;
17311 }
else if (unlikely(__pyx_t_63 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17312 if (__pyx_t_64 < 0) {
17313 __pyx_t_64 += __pyx_pybuffernd_x.diminfo[1].shape;
17314 if (unlikely(__pyx_t_64 < 0)) __pyx_t_12 = 1;
17315 }
else if (unlikely(__pyx_t_64 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17316 if (__pyx_t_65 < 0) {
17317 __pyx_t_65 += __pyx_pybuffernd_x.diminfo[2].shape;
17318 if (unlikely(__pyx_t_65 < 0)) __pyx_t_12 = 2;
17319 }
else if (unlikely(__pyx_t_65 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17320 if (__pyx_t_66 < 0) {
17321 __pyx_t_66 += __pyx_pybuffernd_x.diminfo[3].shape;
17322 if (unlikely(__pyx_t_66 < 0)) __pyx_t_12 = 3;
17323 }
else if (unlikely(__pyx_t_66 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17324 if (unlikely(__pyx_t_12 != -1)) {
17325 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17326 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17328 __pyx_t_67 = __pyx_v_eN;
17329 __pyx_t_68 = __pyx_v_ebN;
17330 __pyx_t_69 = __pyx_v_k;
17333 if (__pyx_t_67 < 0) {
17334 __pyx_t_67 += __pyx_pybuffernd_v.diminfo[0].shape;
17335 if (unlikely(__pyx_t_67 < 0)) __pyx_t_12 = 0;
17336 }
else if (unlikely(__pyx_t_67 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17337 if (__pyx_t_68 < 0) {
17338 __pyx_t_68 += __pyx_pybuffernd_v.diminfo[1].shape;
17339 if (unlikely(__pyx_t_68 < 0)) __pyx_t_12 = 1;
17340 }
else if (unlikely(__pyx_t_68 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17341 if (__pyx_t_69 < 0) {
17342 __pyx_t_69 += __pyx_pybuffernd_v.diminfo[2].shape;
17343 if (unlikely(__pyx_t_69 < 0)) __pyx_t_12 = 2;
17344 }
else if (unlikely(__pyx_t_69 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17345 if (__pyx_t_70 < 0) {
17346 __pyx_t_70 += __pyx_pybuffernd_v.diminfo[3].shape;
17347 if (unlikely(__pyx_t_70 < 0)) __pyx_t_12 = 3;
17348 }
else if (unlikely(__pyx_t_70 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17349 if (unlikely(__pyx_t_12 != -1)) {
17350 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17351 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 850; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17353 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_67, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_68, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_69, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_70, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_63, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_64, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_65, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_66, __pyx_pybuffernd_x.diminfo[3].strides))));
17362 __pyx_t_32 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17363 __Pyx_GOTREF(__pyx_t_32);
17364 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17365 __Pyx_GOTREF(__pyx_t_29);
17366 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17367 __Pyx_GOTREF(__pyx_t_30);
17368 __pyx_t_31 = PyTuple_New(4);
if (unlikely(!__pyx_t_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17369 __Pyx_GOTREF(__pyx_t_31);
17370 __Pyx_GIVEREF(__pyx_t_32);
17371 PyTuple_SET_ITEM(__pyx_t_31, 0, __pyx_t_32);
17372 __Pyx_GIVEREF(__pyx_t_29);
17373 PyTuple_SET_ITEM(__pyx_t_31, 1, __pyx_t_29);
17374 __Pyx_GIVEREF(__pyx_t_30);
17375 PyTuple_SET_ITEM(__pyx_t_31, 2, __pyx_t_30);
17376 __Pyx_INCREF(__pyx_slice__6);
17377 __Pyx_GIVEREF(__pyx_slice__6);
17378 PyTuple_SET_ITEM(__pyx_t_31, 3, __pyx_slice__6);
17382 __pyx_t_30 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_31);
if (unlikely(__pyx_t_30 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
17383 __Pyx_GOTREF(__pyx_t_30);
17384 __pyx_t_34 = (__pyx_v_tForReversal - __pyx_v_t);
17385 __pyx_t_33 = (__pyx_v_tForReversal - 0.0);
17386 if (unlikely(__pyx_t_33 == 0)) {
17387 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
17388 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17390 __pyx_t_29 = PyFloat_FromDouble(((__pyx_t_34 / __pyx_t_33) * __pyx_v_clock));
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17391 __Pyx_GOTREF(__pyx_t_29);
17392 __pyx_t_32 = PyNumber_InPlaceMultiply(__pyx_t_30, __pyx_t_29);
if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17393 __Pyx_GOTREF(__pyx_t_32);
17394 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
17395 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
17396 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_31, __pyx_t_32) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17397 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
17398 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
17421 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17422 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17423 __pyx_v_eN = __pyx_t_3;
17432 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17433 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17434 __pyx_v_ebN = __pyx_t_5;
17443 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
17444 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
17445 __pyx_v_k = __pyx_t_7;
17454 __pyx_t_71 = __pyx_v_eN;
17455 __pyx_t_72 = __pyx_v_ebN;
17456 __pyx_t_73 = __pyx_v_k;
17459 if (__pyx_t_71 < 0) {
17460 __pyx_t_71 += __pyx_pybuffernd_x.diminfo[0].shape;
17461 if (unlikely(__pyx_t_71 < 0)) __pyx_t_12 = 0;
17462 }
else if (unlikely(__pyx_t_71 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17463 if (__pyx_t_72 < 0) {
17464 __pyx_t_72 += __pyx_pybuffernd_x.diminfo[1].shape;
17465 if (unlikely(__pyx_t_72 < 0)) __pyx_t_12 = 1;
17466 }
else if (unlikely(__pyx_t_72 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17467 if (__pyx_t_73 < 0) {
17468 __pyx_t_73 += __pyx_pybuffernd_x.diminfo[2].shape;
17469 if (unlikely(__pyx_t_73 < 0)) __pyx_t_12 = 2;
17470 }
else if (unlikely(__pyx_t_73 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17471 if (__pyx_t_74 < 0) {
17472 __pyx_t_74 += __pyx_pybuffernd_x.diminfo[3].shape;
17473 if (unlikely(__pyx_t_74 < 0)) __pyx_t_12 = 3;
17474 }
else if (unlikely(__pyx_t_74 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17475 if (unlikely(__pyx_t_12 != -1)) {
17476 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17477 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17479 __pyx_t_75 = __pyx_v_eN;
17480 __pyx_t_76 = __pyx_v_ebN;
17481 __pyx_t_77 = __pyx_v_k;
17484 if (__pyx_t_75 < 0) {
17485 __pyx_t_75 += __pyx_pybuffernd_v.diminfo[0].shape;
17486 if (unlikely(__pyx_t_75 < 0)) __pyx_t_12 = 0;
17487 }
else if (unlikely(__pyx_t_75 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17488 if (__pyx_t_76 < 0) {
17489 __pyx_t_76 += __pyx_pybuffernd_v.diminfo[1].shape;
17490 if (unlikely(__pyx_t_76 < 0)) __pyx_t_12 = 1;
17491 }
else if (unlikely(__pyx_t_76 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17492 if (__pyx_t_77 < 0) {
17493 __pyx_t_77 += __pyx_pybuffernd_v.diminfo[2].shape;
17494 if (unlikely(__pyx_t_77 < 0)) __pyx_t_12 = 2;
17495 }
else if (unlikely(__pyx_t_77 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17496 if (__pyx_t_78 < 0) {
17497 __pyx_t_78 += __pyx_pybuffernd_v.diminfo[3].shape;
17498 if (unlikely(__pyx_t_78 < 0)) __pyx_t_12 = 3;
17499 }
else if (unlikely(__pyx_t_78 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17500 if (unlikely(__pyx_t_12 != -1)) {
17501 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17502 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 856; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17504 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_75, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_76, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_77, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_78, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_71, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_72, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_73, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_74, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
17513 __pyx_t_79 = __pyx_v_eN;
17514 __pyx_t_80 = __pyx_v_ebN;
17515 __pyx_t_81 = __pyx_v_k;
17518 if (__pyx_t_79 < 0) {
17519 __pyx_t_79 += __pyx_pybuffernd_x.diminfo[0].shape;
17520 if (unlikely(__pyx_t_79 < 0)) __pyx_t_12 = 0;
17521 }
else if (unlikely(__pyx_t_79 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
17522 if (__pyx_t_80 < 0) {
17523 __pyx_t_80 += __pyx_pybuffernd_x.diminfo[1].shape;
17524 if (unlikely(__pyx_t_80 < 0)) __pyx_t_12 = 1;
17525 }
else if (unlikely(__pyx_t_80 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
17526 if (__pyx_t_81 < 0) {
17527 __pyx_t_81 += __pyx_pybuffernd_x.diminfo[2].shape;
17528 if (unlikely(__pyx_t_81 < 0)) __pyx_t_12 = 2;
17529 }
else if (unlikely(__pyx_t_81 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
17530 if (__pyx_t_82 < 0) {
17531 __pyx_t_82 += __pyx_pybuffernd_x.diminfo[3].shape;
17532 if (unlikely(__pyx_t_82 < 0)) __pyx_t_12 = 3;
17533 }
else if (unlikely(__pyx_t_82 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
17534 if (unlikely(__pyx_t_12 != -1)) {
17535 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17536 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17538 __pyx_t_83 = __pyx_v_eN;
17539 __pyx_t_84 = __pyx_v_ebN;
17540 __pyx_t_85 = __pyx_v_k;
17543 if (__pyx_t_83 < 0) {
17544 __pyx_t_83 += __pyx_pybuffernd_v.diminfo[0].shape;
17545 if (unlikely(__pyx_t_83 < 0)) __pyx_t_12 = 0;
17546 }
else if (unlikely(__pyx_t_83 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
17547 if (__pyx_t_84 < 0) {
17548 __pyx_t_84 += __pyx_pybuffernd_v.diminfo[1].shape;
17549 if (unlikely(__pyx_t_84 < 0)) __pyx_t_12 = 1;
17550 }
else if (unlikely(__pyx_t_84 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
17551 if (__pyx_t_85 < 0) {
17552 __pyx_t_85 += __pyx_pybuffernd_v.diminfo[2].shape;
17553 if (unlikely(__pyx_t_85 < 0)) __pyx_t_12 = 2;
17554 }
else if (unlikely(__pyx_t_85 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
17555 if (__pyx_t_86 < 0) {
17556 __pyx_t_86 += __pyx_pybuffernd_v.diminfo[3].shape;
17557 if (unlikely(__pyx_t_86 < 0)) __pyx_t_12 = 3;
17558 }
else if (unlikely(__pyx_t_86 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
17559 if (unlikely(__pyx_t_12 != -1)) {
17560 __Pyx_RaiseBufferIndexError(__pyx_t_12);
17561 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 857; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17563 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_83, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_84, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_85, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_86, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_79, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_80, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_81, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_82, __pyx_pybuffernd_x.diminfo[3].strides))));
17581 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17584 __Pyx_XDECREF(__pyx_t_29);
17585 __Pyx_XDECREF(__pyx_t_30);
17586 __Pyx_XDECREF(__pyx_t_31);
17587 __Pyx_XDECREF(__pyx_t_32);
17588 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
17589 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
17590 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17591 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17592 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
17593 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.rotatingGaussianElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
17597 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
17598 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
17600 __Pyx_XGIVEREF(__pyx_r);
17601 __Pyx_RefNannyFinishContext();
17614 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
17615 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3 = {
"helicalElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
17616 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_51helicalElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
17617 int __pyx_v_transient;
17619 double __pyx_v_tForReversal;
17620 double __pyx_v_clock;
17621 double __pyx_v_zVelocity;
17624 PyArrayObject *__pyx_v_x = 0;
17625 PyArrayObject *__pyx_v_v = 0;
17626 int __pyx_lineno = 0;
17627 const char *__pyx_filename = NULL;
17628 int __pyx_clineno = 0;
17629 PyObject *__pyx_r = 0;
17630 __Pyx_RefNannyDeclarations
17631 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3 (wrapper)", 0);
17633 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
17634 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
17635 if (unlikely(__pyx_kwds)) {
17636 Py_ssize_t kw_args;
17637 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
17638 switch (pos_args) {
17639 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17640 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17641 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17642 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17643 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17644 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17645 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17646 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17647 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17649 default:
goto __pyx_L5_argtuple_error;
17651 kw_args = PyDict_Size(__pyx_kwds);
17652 switch (pos_args) {
17654 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
17655 else goto __pyx_L5_argtuple_error;
17657 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
17659 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17662 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
17664 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17667 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
17669 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17672 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
17674 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17677 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
17679 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17682 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
17684 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17687 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
17689 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17692 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
17694 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17697 if (unlikely(kw_args > 0)) {
17698 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17700 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
17701 goto __pyx_L5_argtuple_error;
17703 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
17704 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
17705 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
17706 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
17707 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
17708 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
17709 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
17710 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
17711 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
17713 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17714 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 860; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17715 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 861; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17716 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 862; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17717 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 863; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17718 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17719 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 864; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17720 __pyx_v_x = ((PyArrayObject *)values[7]);
17721 __pyx_v_v = ((PyArrayObject *)values[8]);
17723 goto __pyx_L4_argument_unpacking_done;
17724 __pyx_L5_argtuple_error:;
17725 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval3", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
17727 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
17728 __Pyx_RefNannyFinishContext();
17730 __pyx_L4_argument_unpacking_done:;
17731 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17732 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 866; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17733 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
17740 __Pyx_RefNannyFinishContext();
17744 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_50helicalElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
17748 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
17749 __Pyx_Buffer __pyx_pybuffer_v;
17750 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
17751 __Pyx_Buffer __pyx_pybuffer_x;
17752 PyObject *__pyx_r = NULL;
17753 __Pyx_RefNannyDeclarations
17755 npy_intp __pyx_t_2;
17757 npy_intp __pyx_t_4;
17759 Py_ssize_t __pyx_t_6;
17760 Py_ssize_t __pyx_t_7;
17761 Py_ssize_t __pyx_t_8;
17763 Py_ssize_t __pyx_t_10;
17764 Py_ssize_t __pyx_t_11;
17765 Py_ssize_t __pyx_t_12;
17766 Py_ssize_t __pyx_t_13;
17767 Py_ssize_t __pyx_t_14;
17768 Py_ssize_t __pyx_t_15;
17769 Py_ssize_t __pyx_t_16;
17770 Py_ssize_t __pyx_t_17;
17771 Py_ssize_t __pyx_t_18;
17772 Py_ssize_t __pyx_t_19;
17773 Py_ssize_t __pyx_t_20;
17774 Py_ssize_t __pyx_t_21;
17775 PyObject *__pyx_t_22 = NULL;
17776 PyObject *__pyx_t_23 = NULL;
17777 PyObject *__pyx_t_24 = NULL;
17780 PyObject *__pyx_t_27 = NULL;
17781 Py_ssize_t __pyx_t_28;
17782 Py_ssize_t __pyx_t_29;
17783 Py_ssize_t __pyx_t_30;
17784 Py_ssize_t __pyx_t_31;
17785 Py_ssize_t __pyx_t_32;
17786 Py_ssize_t __pyx_t_33;
17787 Py_ssize_t __pyx_t_34;
17788 Py_ssize_t __pyx_t_35;
17789 Py_ssize_t __pyx_t_36;
17790 Py_ssize_t __pyx_t_37;
17791 Py_ssize_t __pyx_t_38;
17792 Py_ssize_t __pyx_t_39;
17793 Py_ssize_t __pyx_t_40;
17794 Py_ssize_t __pyx_t_41;
17795 Py_ssize_t __pyx_t_42;
17796 int __pyx_lineno = 0;
17797 const char *__pyx_filename = NULL;
17798 int __pyx_clineno = 0;
17799 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval3", 0);
17800 __pyx_pybuffer_x.pybuffer.buf = NULL;
17801 __pyx_pybuffer_x.refcount = 0;
17802 __pyx_pybuffernd_x.data = NULL;
17803 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
17804 __pyx_pybuffer_v.pybuffer.buf = NULL;
17805 __pyx_pybuffer_v.refcount = 0;
17806 __pyx_pybuffernd_v.data = NULL;
17807 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
17809 __Pyx_BufFmt_StackElem __pyx_stack[1];
17810 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17812 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
17814 __Pyx_BufFmt_StackElem __pyx_stack[1];
17815 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17817 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
17835 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
17845 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
17846 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
17847 __pyx_v_eN = __pyx_t_3;
17856 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
17857 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
17858 __pyx_v_k = __pyx_t_5;
17867 __pyx_t_6 = __pyx_v_eN;
17868 __pyx_t_7 = __pyx_v_k;
17871 if (__pyx_t_6 < 0) {
17872 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[0].shape;
17873 if (unlikely(__pyx_t_6 < 0)) __pyx_t_9 = 0;
17874 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
17875 if (__pyx_t_7 < 0) {
17876 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[1].shape;
17877 if (unlikely(__pyx_t_7 < 0)) __pyx_t_9 = 1;
17878 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
17879 if (__pyx_t_8 < 0) {
17880 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[2].shape;
17881 if (unlikely(__pyx_t_8 < 0)) __pyx_t_9 = 2;
17882 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
17883 if (unlikely(__pyx_t_9 != -1)) {
17884 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17885 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17887 __pyx_t_10 = __pyx_v_eN;
17888 __pyx_t_11 = __pyx_v_k;
17891 if (__pyx_t_10 < 0) {
17892 __pyx_t_10 += __pyx_pybuffernd_v.diminfo[0].shape;
17893 if (unlikely(__pyx_t_10 < 0)) __pyx_t_9 = 0;
17894 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
17895 if (__pyx_t_11 < 0) {
17896 __pyx_t_11 += __pyx_pybuffernd_v.diminfo[1].shape;
17897 if (unlikely(__pyx_t_11 < 0)) __pyx_t_9 = 1;
17898 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
17899 if (__pyx_t_12 < 0) {
17900 __pyx_t_12 += __pyx_pybuffernd_v.diminfo[2].shape;
17901 if (unlikely(__pyx_t_12 < 0)) __pyx_t_9 = 2;
17902 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
17903 if (unlikely(__pyx_t_9 != -1)) {
17904 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17905 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 873; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17907 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_10, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_11, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_12, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_6, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
17916 __pyx_t_13 = __pyx_v_eN;
17917 __pyx_t_14 = __pyx_v_k;
17920 if (__pyx_t_13 < 0) {
17921 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[0].shape;
17922 if (unlikely(__pyx_t_13 < 0)) __pyx_t_9 = 0;
17923 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
17924 if (__pyx_t_14 < 0) {
17925 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[1].shape;
17926 if (unlikely(__pyx_t_14 < 0)) __pyx_t_9 = 1;
17927 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
17928 if (__pyx_t_15 < 0) {
17929 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[2].shape;
17930 if (unlikely(__pyx_t_15 < 0)) __pyx_t_9 = 2;
17931 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
17932 if (unlikely(__pyx_t_9 != -1)) {
17933 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17934 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17936 __pyx_t_16 = __pyx_v_eN;
17937 __pyx_t_17 = __pyx_v_k;
17940 if (__pyx_t_16 < 0) {
17941 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[0].shape;
17942 if (unlikely(__pyx_t_16 < 0)) __pyx_t_9 = 0;
17943 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
17944 if (__pyx_t_17 < 0) {
17945 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[1].shape;
17946 if (unlikely(__pyx_t_17 < 0)) __pyx_t_9 = 1;
17947 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
17948 if (__pyx_t_18 < 0) {
17949 __pyx_t_18 += __pyx_pybuffernd_v.diminfo[2].shape;
17950 if (unlikely(__pyx_t_18 < 0)) __pyx_t_9 = 2;
17951 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
17952 if (unlikely(__pyx_t_9 != -1)) {
17953 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17954 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 874; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17956 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[2].strides))));
17965 __pyx_t_19 = __pyx_v_eN;
17966 __pyx_t_20 = __pyx_v_k;
17969 if (__pyx_t_19 < 0) {
17970 __pyx_t_19 += __pyx_pybuffernd_v.diminfo[0].shape;
17971 if (unlikely(__pyx_t_19 < 0)) __pyx_t_9 = 0;
17972 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
17973 if (__pyx_t_20 < 0) {
17974 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[1].shape;
17975 if (unlikely(__pyx_t_20 < 0)) __pyx_t_9 = 1;
17976 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
17977 if (__pyx_t_21 < 0) {
17978 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[2].shape;
17979 if (unlikely(__pyx_t_21 < 0)) __pyx_t_9 = 2;
17980 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
17981 if (unlikely(__pyx_t_9 != -1)) {
17982 __Pyx_RaiseBufferIndexError(__pyx_t_9);
17983 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 875; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17985 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_19, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_20, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
17994 __pyx_t_22 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17995 __Pyx_GOTREF(__pyx_t_22);
17996 __pyx_t_23 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17997 __Pyx_GOTREF(__pyx_t_23);
17998 __pyx_t_24 = PyTuple_New(3);
if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
17999 __Pyx_GOTREF(__pyx_t_24);
18000 __Pyx_GIVEREF(__pyx_t_22);
18001 PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_22);
18002 __Pyx_GIVEREF(__pyx_t_23);
18003 PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_23);
18004 __Pyx_INCREF(__pyx_slice__7);
18005 __Pyx_GIVEREF(__pyx_slice__7);
18006 PyTuple_SET_ITEM(__pyx_t_24, 2, __pyx_slice__7);
18009 __pyx_t_23 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_24);
if (unlikely(__pyx_t_23 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
18010 __Pyx_GOTREF(__pyx_t_23);
18011 __pyx_t_25 = (__pyx_v_pi * __pyx_v_t);
18012 __pyx_t_26 = (__pyx_v_tForReversal * 2.0);
18013 if (unlikely(__pyx_t_26 == 0)) {
18014 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18015 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18017 __pyx_t_22 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_25 / __pyx_t_26))));
if (unlikely(!__pyx_t_22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18018 __Pyx_GOTREF(__pyx_t_22);
18019 __pyx_t_27 = PyNumber_InPlaceMultiply(__pyx_t_23, __pyx_t_22);
if (unlikely(!__pyx_t_27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18020 __Pyx_GOTREF(__pyx_t_27);
18021 __Pyx_DECREF(__pyx_t_23); __pyx_t_23 = 0;
18022 __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
18023 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_24, __pyx_t_27) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18024 __Pyx_DECREF(__pyx_t_27); __pyx_t_27 = 0;
18025 __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
18047 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18048 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18049 __pyx_v_eN = __pyx_t_3;
18058 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18059 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18060 __pyx_v_k = __pyx_t_5;
18069 __pyx_t_28 = __pyx_v_eN;
18070 __pyx_t_29 = __pyx_v_k;
18073 if (__pyx_t_28 < 0) {
18074 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
18075 if (unlikely(__pyx_t_28 < 0)) __pyx_t_9 = 0;
18076 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18077 if (__pyx_t_29 < 0) {
18078 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
18079 if (unlikely(__pyx_t_29 < 0)) __pyx_t_9 = 1;
18080 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18081 if (__pyx_t_30 < 0) {
18082 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
18083 if (unlikely(__pyx_t_30 < 0)) __pyx_t_9 = 2;
18084 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18085 if (unlikely(__pyx_t_9 != -1)) {
18086 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18087 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18089 __pyx_t_31 = __pyx_v_eN;
18090 __pyx_t_32 = __pyx_v_k;
18093 if (__pyx_t_31 < 0) {
18094 __pyx_t_31 += __pyx_pybuffernd_v.diminfo[0].shape;
18095 if (unlikely(__pyx_t_31 < 0)) __pyx_t_9 = 0;
18096 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18097 if (__pyx_t_32 < 0) {
18098 __pyx_t_32 += __pyx_pybuffernd_v.diminfo[1].shape;
18099 if (unlikely(__pyx_t_32 < 0)) __pyx_t_9 = 1;
18100 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18101 if (__pyx_t_33 < 0) {
18102 __pyx_t_33 += __pyx_pybuffernd_v.diminfo[2].shape;
18103 if (unlikely(__pyx_t_33 < 0)) __pyx_t_9 = 2;
18104 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18105 if (unlikely(__pyx_t_9 != -1)) {
18106 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18107 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 880; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18109 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_31, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_32, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_33, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides)) - __pyx_v_xc));
18118 __pyx_t_34 = __pyx_v_eN;
18119 __pyx_t_35 = __pyx_v_k;
18122 if (__pyx_t_34 < 0) {
18123 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[0].shape;
18124 if (unlikely(__pyx_t_34 < 0)) __pyx_t_9 = 0;
18125 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_9 = 0;
18126 if (__pyx_t_35 < 0) {
18127 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[1].shape;
18128 if (unlikely(__pyx_t_35 < 0)) __pyx_t_9 = 1;
18129 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_9 = 1;
18130 if (__pyx_t_36 < 0) {
18131 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[2].shape;
18132 if (unlikely(__pyx_t_36 < 0)) __pyx_t_9 = 2;
18133 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_9 = 2;
18134 if (unlikely(__pyx_t_9 != -1)) {
18135 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18136 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18138 __pyx_t_37 = __pyx_v_eN;
18139 __pyx_t_38 = __pyx_v_k;
18142 if (__pyx_t_37 < 0) {
18143 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[0].shape;
18144 if (unlikely(__pyx_t_37 < 0)) __pyx_t_9 = 0;
18145 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18146 if (__pyx_t_38 < 0) {
18147 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[1].shape;
18148 if (unlikely(__pyx_t_38 < 0)) __pyx_t_9 = 1;
18149 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18150 if (__pyx_t_39 < 0) {
18151 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[2].shape;
18152 if (unlikely(__pyx_t_39 < 0)) __pyx_t_9 = 2;
18153 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18154 if (unlikely(__pyx_t_9 != -1)) {
18155 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18156 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 881; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18158 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_37, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[2].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_34, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[2].strides))));
18167 __pyx_t_40 = __pyx_v_eN;
18168 __pyx_t_41 = __pyx_v_k;
18171 if (__pyx_t_40 < 0) {
18172 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[0].shape;
18173 if (unlikely(__pyx_t_40 < 0)) __pyx_t_9 = 0;
18174 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_9 = 0;
18175 if (__pyx_t_41 < 0) {
18176 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[1].shape;
18177 if (unlikely(__pyx_t_41 < 0)) __pyx_t_9 = 1;
18178 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_9 = 1;
18179 if (__pyx_t_42 < 0) {
18180 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[2].shape;
18181 if (unlikely(__pyx_t_42 < 0)) __pyx_t_9 = 2;
18182 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_9 = 2;
18183 if (unlikely(__pyx_t_9 != -1)) {
18184 __Pyx_RaiseBufferIndexError(__pyx_t_9);
18185 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 882; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18187 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_40, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[2].strides) = __pyx_v_zVelocity;
18202 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18205 __Pyx_XDECREF(__pyx_t_22);
18206 __Pyx_XDECREF(__pyx_t_23);
18207 __Pyx_XDECREF(__pyx_t_24);
18208 __Pyx_XDECREF(__pyx_t_27);
18209 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18210 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18211 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18212 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18213 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18214 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
18218 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18219 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18221 __Pyx_XGIVEREF(__pyx_r);
18222 __Pyx_RefNannyFinishContext();
18235 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18236 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4 = {
"helicalElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
18237 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_53helicalElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18238 int __pyx_v_transient;
18240 double __pyx_v_tForReversal;
18241 double __pyx_v_clock;
18242 double __pyx_v_zVelocity;
18245 PyArrayObject *__pyx_v_x = 0;
18246 PyArrayObject *__pyx_v_v = 0;
18247 int __pyx_lineno = 0;
18248 const char *__pyx_filename = NULL;
18249 int __pyx_clineno = 0;
18250 PyObject *__pyx_r = 0;
18251 __Pyx_RefNannyDeclarations
18252 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4 (wrapper)", 0);
18254 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_transient,&__pyx_n_s_t,&__pyx_n_s_tForReversal,&__pyx_n_s_clock,&__pyx_n_s_zVelocity,&__pyx_n_s_xc,&__pyx_n_s_yc,&__pyx_n_s_x,&__pyx_n_s_v,0};
18255 PyObject* values[9] = {0,0,0,0,0,0,0,0,0};
18256 if (unlikely(__pyx_kwds)) {
18257 Py_ssize_t kw_args;
18258 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18259 switch (pos_args) {
18260 case 9: values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18261 case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18262 case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18263 case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18264 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18265 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18266 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18267 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18268 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18270 default:
goto __pyx_L5_argtuple_error;
18272 kw_args = PyDict_Size(__pyx_kwds);
18273 switch (pos_args) {
18275 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_transient)) != 0)) kw_args--;
18276 else goto __pyx_L5_argtuple_error;
18278 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18280 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18283 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_tForReversal)) != 0)) kw_args--;
18285 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18288 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_clock)) != 0)) kw_args--;
18290 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18293 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_zVelocity)) != 0)) kw_args--;
18295 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18298 if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_xc)) != 0)) kw_args--;
18300 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18303 if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_yc)) != 0)) kw_args--;
18305 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18308 if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18310 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18313 if (likely((values[8] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
18315 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, 8); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18318 if (unlikely(kw_args > 0)) {
18319 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"helicalElementVelocityEval4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18321 }
else if (PyTuple_GET_SIZE(__pyx_args) != 9) {
18322 goto __pyx_L5_argtuple_error;
18324 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18325 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18326 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18327 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
18328 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
18329 values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
18330 values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
18331 values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
18332 values[8] = PyTuple_GET_ITEM(__pyx_args, 8);
18334 __pyx_v_transient = __Pyx_PyInt_As_int(values[0]);
if (unlikely((__pyx_v_transient == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18335 __pyx_v_t = __pyx_PyFloat_AsDouble(values[1]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 885; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18336 __pyx_v_tForReversal = __pyx_PyFloat_AsDouble(values[2]);
if (unlikely((__pyx_v_tForReversal == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 886; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18337 __pyx_v_clock = __pyx_PyFloat_AsDouble(values[3]);
if (unlikely((__pyx_v_clock == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 887; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18338 __pyx_v_zVelocity = __pyx_PyFloat_AsDouble(values[4]);
if (unlikely((__pyx_v_zVelocity == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 888; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18339 __pyx_v_xc = __pyx_PyFloat_AsDouble(values[5]);
if (unlikely((__pyx_v_xc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18340 __pyx_v_yc = __pyx_PyFloat_AsDouble(values[6]);
if (unlikely((__pyx_v_yc == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 889; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18341 __pyx_v_x = ((PyArrayObject *)values[7]);
18342 __pyx_v_v = ((PyArrayObject *)values[8]);
18344 goto __pyx_L4_argument_unpacking_done;
18345 __pyx_L5_argtuple_error:;
18346 __Pyx_RaiseArgtupleInvalid(
"helicalElementVelocityEval4", 1, 9, 9, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18348 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18349 __Pyx_RefNannyFinishContext();
18351 __pyx_L4_argument_unpacking_done:;
18352 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 890; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18353 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 891; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18354 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(__pyx_self, __pyx_v_transient, __pyx_v_t, __pyx_v_tForReversal, __pyx_v_clock, __pyx_v_zVelocity, __pyx_v_xc, __pyx_v_yc, __pyx_v_x, __pyx_v_v);
18361 __Pyx_RefNannyFinishContext();
18365 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_52helicalElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
int __pyx_v_transient,
double __pyx_v_t,
double __pyx_v_tForReversal,
double __pyx_v_clock,
double __pyx_v_zVelocity,
double __pyx_v_xc,
double __pyx_v_yc, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
18370 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
18371 __Pyx_Buffer __pyx_pybuffer_v;
18372 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
18373 __Pyx_Buffer __pyx_pybuffer_x;
18374 PyObject *__pyx_r = NULL;
18375 __Pyx_RefNannyDeclarations
18377 npy_intp __pyx_t_2;
18379 npy_intp __pyx_t_4;
18381 npy_intp __pyx_t_6;
18383 Py_ssize_t __pyx_t_8;
18384 Py_ssize_t __pyx_t_9;
18385 Py_ssize_t __pyx_t_10;
18386 Py_ssize_t __pyx_t_11;
18388 Py_ssize_t __pyx_t_13;
18389 Py_ssize_t __pyx_t_14;
18390 Py_ssize_t __pyx_t_15;
18391 Py_ssize_t __pyx_t_16;
18392 Py_ssize_t __pyx_t_17;
18393 Py_ssize_t __pyx_t_18;
18394 Py_ssize_t __pyx_t_19;
18395 Py_ssize_t __pyx_t_20;
18396 Py_ssize_t __pyx_t_21;
18397 Py_ssize_t __pyx_t_22;
18398 Py_ssize_t __pyx_t_23;
18399 Py_ssize_t __pyx_t_24;
18400 Py_ssize_t __pyx_t_25;
18401 Py_ssize_t __pyx_t_26;
18402 Py_ssize_t __pyx_t_27;
18403 Py_ssize_t __pyx_t_28;
18404 PyObject *__pyx_t_29 = NULL;
18405 PyObject *__pyx_t_30 = NULL;
18406 PyObject *__pyx_t_31 = NULL;
18407 PyObject *__pyx_t_32 = NULL;
18410 Py_ssize_t __pyx_t_35;
18411 Py_ssize_t __pyx_t_36;
18412 Py_ssize_t __pyx_t_37;
18413 Py_ssize_t __pyx_t_38;
18414 Py_ssize_t __pyx_t_39;
18415 Py_ssize_t __pyx_t_40;
18416 Py_ssize_t __pyx_t_41;
18417 Py_ssize_t __pyx_t_42;
18418 Py_ssize_t __pyx_t_43;
18419 Py_ssize_t __pyx_t_44;
18420 Py_ssize_t __pyx_t_45;
18421 Py_ssize_t __pyx_t_46;
18422 Py_ssize_t __pyx_t_47;
18423 Py_ssize_t __pyx_t_48;
18424 Py_ssize_t __pyx_t_49;
18425 Py_ssize_t __pyx_t_50;
18426 Py_ssize_t __pyx_t_51;
18427 Py_ssize_t __pyx_t_52;
18428 Py_ssize_t __pyx_t_53;
18429 Py_ssize_t __pyx_t_54;
18430 int __pyx_lineno = 0;
18431 const char *__pyx_filename = NULL;
18432 int __pyx_clineno = 0;
18433 __Pyx_RefNannySetupContext(
"helicalElementVelocityEval4", 0);
18434 __pyx_pybuffer_x.pybuffer.buf = NULL;
18435 __pyx_pybuffer_x.refcount = 0;
18436 __pyx_pybuffernd_x.data = NULL;
18437 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
18438 __pyx_pybuffer_v.pybuffer.buf = NULL;
18439 __pyx_pybuffer_v.refcount = 0;
18440 __pyx_pybuffernd_v.data = NULL;
18441 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
18443 __Pyx_BufFmt_StackElem __pyx_stack[1];
18444 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18446 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
18448 __Pyx_BufFmt_StackElem __pyx_stack[1];
18449 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18451 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
18469 __pyx_t_1 = ((__pyx_v_transient == 1) != 0);
18479 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18480 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18481 __pyx_v_eN = __pyx_t_3;
18490 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18491 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18492 __pyx_v_ebN = __pyx_t_5;
18501 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
18502 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18503 __pyx_v_k = __pyx_t_7;
18512 __pyx_t_8 = __pyx_v_eN;
18513 __pyx_t_9 = __pyx_v_ebN;
18514 __pyx_t_10 = __pyx_v_k;
18517 if (__pyx_t_8 < 0) {
18518 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[0].shape;
18519 if (unlikely(__pyx_t_8 < 0)) __pyx_t_12 = 0;
18520 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18521 if (__pyx_t_9 < 0) {
18522 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[1].shape;
18523 if (unlikely(__pyx_t_9 < 0)) __pyx_t_12 = 1;
18524 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18525 if (__pyx_t_10 < 0) {
18526 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[2].shape;
18527 if (unlikely(__pyx_t_10 < 0)) __pyx_t_12 = 2;
18528 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18529 if (__pyx_t_11 < 0) {
18530 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[3].shape;
18531 if (unlikely(__pyx_t_11 < 0)) __pyx_t_12 = 3;
18532 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18533 if (unlikely(__pyx_t_12 != -1)) {
18534 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18535 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18537 __pyx_t_13 = __pyx_v_eN;
18538 __pyx_t_14 = __pyx_v_ebN;
18539 __pyx_t_15 = __pyx_v_k;
18542 if (__pyx_t_13 < 0) {
18543 __pyx_t_13 += __pyx_pybuffernd_v.diminfo[0].shape;
18544 if (unlikely(__pyx_t_13 < 0)) __pyx_t_12 = 0;
18545 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18546 if (__pyx_t_14 < 0) {
18547 __pyx_t_14 += __pyx_pybuffernd_v.diminfo[1].shape;
18548 if (unlikely(__pyx_t_14 < 0)) __pyx_t_12 = 1;
18549 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18550 if (__pyx_t_15 < 0) {
18551 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[2].shape;
18552 if (unlikely(__pyx_t_15 < 0)) __pyx_t_12 = 2;
18553 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18554 if (__pyx_t_16 < 0) {
18555 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[3].shape;
18556 if (unlikely(__pyx_t_16 < 0)) __pyx_t_12 = 3;
18557 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18558 if (unlikely(__pyx_t_12 != -1)) {
18559 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18560 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 899; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18562 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_14, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_15, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_8, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18571 __pyx_t_17 = __pyx_v_eN;
18572 __pyx_t_18 = __pyx_v_ebN;
18573 __pyx_t_19 = __pyx_v_k;
18576 if (__pyx_t_17 < 0) {
18577 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[0].shape;
18578 if (unlikely(__pyx_t_17 < 0)) __pyx_t_12 = 0;
18579 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18580 if (__pyx_t_18 < 0) {
18581 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[1].shape;
18582 if (unlikely(__pyx_t_18 < 0)) __pyx_t_12 = 1;
18583 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18584 if (__pyx_t_19 < 0) {
18585 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[2].shape;
18586 if (unlikely(__pyx_t_19 < 0)) __pyx_t_12 = 2;
18587 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18588 if (__pyx_t_20 < 0) {
18589 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[3].shape;
18590 if (unlikely(__pyx_t_20 < 0)) __pyx_t_12 = 3;
18591 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18592 if (unlikely(__pyx_t_12 != -1)) {
18593 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18594 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18596 __pyx_t_21 = __pyx_v_eN;
18597 __pyx_t_22 = __pyx_v_ebN;
18598 __pyx_t_23 = __pyx_v_k;
18601 if (__pyx_t_21 < 0) {
18602 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[0].shape;
18603 if (unlikely(__pyx_t_21 < 0)) __pyx_t_12 = 0;
18604 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18605 if (__pyx_t_22 < 0) {
18606 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[1].shape;
18607 if (unlikely(__pyx_t_22 < 0)) __pyx_t_12 = 1;
18608 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18609 if (__pyx_t_23 < 0) {
18610 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[2].shape;
18611 if (unlikely(__pyx_t_23 < 0)) __pyx_t_12 = 2;
18612 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18613 if (__pyx_t_24 < 0) {
18614 __pyx_t_24 += __pyx_pybuffernd_v.diminfo[3].shape;
18615 if (unlikely(__pyx_t_24 < 0)) __pyx_t_12 = 3;
18616 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18617 if (unlikely(__pyx_t_12 != -1)) {
18618 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18619 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 900; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18621 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_24, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_17, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[3].strides))));
18630 __pyx_t_25 = __pyx_v_eN;
18631 __pyx_t_26 = __pyx_v_ebN;
18632 __pyx_t_27 = __pyx_v_k;
18635 if (__pyx_t_25 < 0) {
18636 __pyx_t_25 += __pyx_pybuffernd_v.diminfo[0].shape;
18637 if (unlikely(__pyx_t_25 < 0)) __pyx_t_12 = 0;
18638 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18639 if (__pyx_t_26 < 0) {
18640 __pyx_t_26 += __pyx_pybuffernd_v.diminfo[1].shape;
18641 if (unlikely(__pyx_t_26 < 0)) __pyx_t_12 = 1;
18642 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18643 if (__pyx_t_27 < 0) {
18644 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[2].shape;
18645 if (unlikely(__pyx_t_27 < 0)) __pyx_t_12 = 2;
18646 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18647 if (__pyx_t_28 < 0) {
18648 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[3].shape;
18649 if (unlikely(__pyx_t_28 < 0)) __pyx_t_12 = 3;
18650 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18651 if (unlikely(__pyx_t_12 != -1)) {
18652 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18653 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 901; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18655 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_25, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_26, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_27, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
18664 __pyx_t_29 = __Pyx_PyInt_From_int(__pyx_v_eN);
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18665 __Pyx_GOTREF(__pyx_t_29);
18666 __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_ebN);
if (unlikely(!__pyx_t_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18667 __Pyx_GOTREF(__pyx_t_30);
18668 __pyx_t_31 = __Pyx_PyInt_From_int(__pyx_v_k);
if (unlikely(!__pyx_t_31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18669 __Pyx_GOTREF(__pyx_t_31);
18670 __pyx_t_32 = PyTuple_New(4);
if (unlikely(!__pyx_t_32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18671 __Pyx_GOTREF(__pyx_t_32);
18672 __Pyx_GIVEREF(__pyx_t_29);
18673 PyTuple_SET_ITEM(__pyx_t_32, 0, __pyx_t_29);
18674 __Pyx_GIVEREF(__pyx_t_30);
18675 PyTuple_SET_ITEM(__pyx_t_32, 1, __pyx_t_30);
18676 __Pyx_GIVEREF(__pyx_t_31);
18677 PyTuple_SET_ITEM(__pyx_t_32, 2, __pyx_t_31);
18678 __Pyx_INCREF(__pyx_slice__8);
18679 __Pyx_GIVEREF(__pyx_slice__8);
18680 PyTuple_SET_ITEM(__pyx_t_32, 3, __pyx_slice__8);
18684 __pyx_t_31 = PyObject_GetItem(((PyObject *)__pyx_v_v), __pyx_t_32);
if (unlikely(__pyx_t_31 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
18685 __Pyx_GOTREF(__pyx_t_31);
18686 __pyx_t_33 = (__pyx_v_pi * __pyx_v_t);
18687 __pyx_t_34 = (__pyx_v_tForReversal * 2.0);
18688 if (unlikely(__pyx_t_34 == 0)) {
18689 PyErr_SetString(PyExc_ZeroDivisionError,
"float division");
18690 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18692 __pyx_t_30 = PyFloat_FromDouble((__pyx_v_clock * cos((__pyx_t_33 / __pyx_t_34))));
if (unlikely(!__pyx_t_30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18693 __Pyx_GOTREF(__pyx_t_30);
18694 __pyx_t_29 = PyNumber_InPlaceMultiply(__pyx_t_31, __pyx_t_30);
if (unlikely(!__pyx_t_29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18695 __Pyx_GOTREF(__pyx_t_29);
18696 __Pyx_DECREF(__pyx_t_31); __pyx_t_31 = 0;
18697 __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
18698 if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_v), __pyx_t_32, __pyx_t_29) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18699 __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
18700 __Pyx_DECREF(__pyx_t_32); __pyx_t_32 = 0;
18723 __pyx_t_2 = (__pyx_v_x->dimensions[0]);
18724 for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
18725 __pyx_v_eN = __pyx_t_3;
18734 __pyx_t_4 = (__pyx_v_x->dimensions[1]);
18735 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
18736 __pyx_v_ebN = __pyx_t_5;
18745 __pyx_t_6 = (__pyx_v_x->dimensions[2]);
18746 for (__pyx_t_7 = 0; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
18747 __pyx_v_k = __pyx_t_7;
18756 __pyx_t_35 = __pyx_v_eN;
18757 __pyx_t_36 = __pyx_v_ebN;
18758 __pyx_t_37 = __pyx_v_k;
18761 if (__pyx_t_35 < 0) {
18762 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[0].shape;
18763 if (unlikely(__pyx_t_35 < 0)) __pyx_t_12 = 0;
18764 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18765 if (__pyx_t_36 < 0) {
18766 __pyx_t_36 += __pyx_pybuffernd_x.diminfo[1].shape;
18767 if (unlikely(__pyx_t_36 < 0)) __pyx_t_12 = 1;
18768 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18769 if (__pyx_t_37 < 0) {
18770 __pyx_t_37 += __pyx_pybuffernd_x.diminfo[2].shape;
18771 if (unlikely(__pyx_t_37 < 0)) __pyx_t_12 = 2;
18772 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18773 if (__pyx_t_38 < 0) {
18774 __pyx_t_38 += __pyx_pybuffernd_x.diminfo[3].shape;
18775 if (unlikely(__pyx_t_38 < 0)) __pyx_t_12 = 3;
18776 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18777 if (unlikely(__pyx_t_12 != -1)) {
18778 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18779 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18781 __pyx_t_39 = __pyx_v_eN;
18782 __pyx_t_40 = __pyx_v_ebN;
18783 __pyx_t_41 = __pyx_v_k;
18786 if (__pyx_t_39 < 0) {
18787 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[0].shape;
18788 if (unlikely(__pyx_t_39 < 0)) __pyx_t_12 = 0;
18789 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18790 if (__pyx_t_40 < 0) {
18791 __pyx_t_40 += __pyx_pybuffernd_v.diminfo[1].shape;
18792 if (unlikely(__pyx_t_40 < 0)) __pyx_t_12 = 1;
18793 }
else if (unlikely(__pyx_t_40 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18794 if (__pyx_t_41 < 0) {
18795 __pyx_t_41 += __pyx_pybuffernd_v.diminfo[2].shape;
18796 if (unlikely(__pyx_t_41 < 0)) __pyx_t_12 = 2;
18797 }
else if (unlikely(__pyx_t_41 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18798 if (__pyx_t_42 < 0) {
18799 __pyx_t_42 += __pyx_pybuffernd_v.diminfo[3].shape;
18800 if (unlikely(__pyx_t_42 < 0)) __pyx_t_12 = 3;
18801 }
else if (unlikely(__pyx_t_42 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18802 if (unlikely(__pyx_t_12 != -1)) {
18803 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18804 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 907; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18806 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_39, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_40, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_41, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_42, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * ((*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_35, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_36, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_37, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_38, __pyx_pybuffernd_x.diminfo[3].strides)) - __pyx_v_xc));
18815 __pyx_t_43 = __pyx_v_eN;
18816 __pyx_t_44 = __pyx_v_ebN;
18817 __pyx_t_45 = __pyx_v_k;
18820 if (__pyx_t_43 < 0) {
18821 __pyx_t_43 += __pyx_pybuffernd_x.diminfo[0].shape;
18822 if (unlikely(__pyx_t_43 < 0)) __pyx_t_12 = 0;
18823 }
else if (unlikely(__pyx_t_43 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_12 = 0;
18824 if (__pyx_t_44 < 0) {
18825 __pyx_t_44 += __pyx_pybuffernd_x.diminfo[1].shape;
18826 if (unlikely(__pyx_t_44 < 0)) __pyx_t_12 = 1;
18827 }
else if (unlikely(__pyx_t_44 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_12 = 1;
18828 if (__pyx_t_45 < 0) {
18829 __pyx_t_45 += __pyx_pybuffernd_x.diminfo[2].shape;
18830 if (unlikely(__pyx_t_45 < 0)) __pyx_t_12 = 2;
18831 }
else if (unlikely(__pyx_t_45 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_12 = 2;
18832 if (__pyx_t_46 < 0) {
18833 __pyx_t_46 += __pyx_pybuffernd_x.diminfo[3].shape;
18834 if (unlikely(__pyx_t_46 < 0)) __pyx_t_12 = 3;
18835 }
else if (unlikely(__pyx_t_46 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_12 = 3;
18836 if (unlikely(__pyx_t_12 != -1)) {
18837 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18838 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18840 __pyx_t_47 = __pyx_v_eN;
18841 __pyx_t_48 = __pyx_v_ebN;
18842 __pyx_t_49 = __pyx_v_k;
18845 if (__pyx_t_47 < 0) {
18846 __pyx_t_47 += __pyx_pybuffernd_v.diminfo[0].shape;
18847 if (unlikely(__pyx_t_47 < 0)) __pyx_t_12 = 0;
18848 }
else if (unlikely(__pyx_t_47 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18849 if (__pyx_t_48 < 0) {
18850 __pyx_t_48 += __pyx_pybuffernd_v.diminfo[1].shape;
18851 if (unlikely(__pyx_t_48 < 0)) __pyx_t_12 = 1;
18852 }
else if (unlikely(__pyx_t_48 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18853 if (__pyx_t_49 < 0) {
18854 __pyx_t_49 += __pyx_pybuffernd_v.diminfo[2].shape;
18855 if (unlikely(__pyx_t_49 < 0)) __pyx_t_12 = 2;
18856 }
else if (unlikely(__pyx_t_49 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18857 if (__pyx_t_50 < 0) {
18858 __pyx_t_50 += __pyx_pybuffernd_v.diminfo[3].shape;
18859 if (unlikely(__pyx_t_50 < 0)) __pyx_t_12 = 3;
18860 }
else if (unlikely(__pyx_t_50 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18861 if (unlikely(__pyx_t_12 != -1)) {
18862 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18863 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18865 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_47, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_48, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_49, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_50, __pyx_pybuffernd_v.diminfo[3].strides) = ((2.0 * __pyx_v_pi) * (__pyx_v_yc - (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_43, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_44, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_45, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_46, __pyx_pybuffernd_x.diminfo[3].strides))));
18874 __pyx_t_51 = __pyx_v_eN;
18875 __pyx_t_52 = __pyx_v_ebN;
18876 __pyx_t_53 = __pyx_v_k;
18879 if (__pyx_t_51 < 0) {
18880 __pyx_t_51 += __pyx_pybuffernd_v.diminfo[0].shape;
18881 if (unlikely(__pyx_t_51 < 0)) __pyx_t_12 = 0;
18882 }
else if (unlikely(__pyx_t_51 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_12 = 0;
18883 if (__pyx_t_52 < 0) {
18884 __pyx_t_52 += __pyx_pybuffernd_v.diminfo[1].shape;
18885 if (unlikely(__pyx_t_52 < 0)) __pyx_t_12 = 1;
18886 }
else if (unlikely(__pyx_t_52 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_12 = 1;
18887 if (__pyx_t_53 < 0) {
18888 __pyx_t_53 += __pyx_pybuffernd_v.diminfo[2].shape;
18889 if (unlikely(__pyx_t_53 < 0)) __pyx_t_12 = 2;
18890 }
else if (unlikely(__pyx_t_53 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_12 = 2;
18891 if (__pyx_t_54 < 0) {
18892 __pyx_t_54 += __pyx_pybuffernd_v.diminfo[3].shape;
18893 if (unlikely(__pyx_t_54 < 0)) __pyx_t_12 = 3;
18894 }
else if (unlikely(__pyx_t_54 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_12 = 3;
18895 if (unlikely(__pyx_t_12 != -1)) {
18896 __Pyx_RaiseBufferIndexError(__pyx_t_12);
18897 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 909; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
18899 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_51, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_52, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_53, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_54, __pyx_pybuffernd_v.diminfo[3].strides) = __pyx_v_zVelocity;
18915 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
18918 __Pyx_XDECREF(__pyx_t_29);
18919 __Pyx_XDECREF(__pyx_t_30);
18920 __Pyx_XDECREF(__pyx_t_31);
18921 __Pyx_XDECREF(__pyx_t_32);
18922 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
18923 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
18924 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18925 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18926 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
18927 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.helicalElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
18931 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
18932 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
18934 __Pyx_XGIVEREF(__pyx_r);
18935 __Pyx_RefNannyFinishContext();
18948 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
18949 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3 = {
"vortexElementVelocityEval3", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, METH_VARARGS|METH_KEYWORDS, 0};
18950 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_55vortexElementVelocityEval3(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
18952 PyArrayObject *__pyx_v_x = 0;
18953 PyArrayObject *__pyx_v_v = 0;
18954 int __pyx_lineno = 0;
18955 const char *__pyx_filename = NULL;
18956 int __pyx_clineno = 0;
18957 PyObject *__pyx_r = 0;
18958 __Pyx_RefNannyDeclarations
18959 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3 (wrapper)", 0);
18961 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
18962 PyObject* values[3] = {0,0,0};
18963 if (unlikely(__pyx_kwds)) {
18964 Py_ssize_t kw_args;
18965 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
18966 switch (pos_args) {
18967 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18968 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18969 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18971 default:
goto __pyx_L5_argtuple_error;
18973 kw_args = PyDict_Size(__pyx_kwds);
18974 switch (pos_args) {
18976 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
18977 else goto __pyx_L5_argtuple_error;
18979 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
18981 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18984 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
18986 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18989 if (unlikely(kw_args > 0)) {
18990 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval3") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
18992 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
18993 goto __pyx_L5_argtuple_error;
18995 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
18996 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
18997 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
18999 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19000 __pyx_v_x = ((PyArrayObject *)values[1]);
19001 __pyx_v_v = ((PyArrayObject *)values[2]);
19003 goto __pyx_L4_argument_unpacking_done;
19004 __pyx_L5_argtuple_error:;
19005 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval3", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19007 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19008 __Pyx_RefNannyFinishContext();
19010 __pyx_L4_argument_unpacking_done:;
19011 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 912; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19012 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 913; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19013 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
19020 __Pyx_RefNannyFinishContext();
19024 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_54vortexElementVelocityEval3(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19028 double __pyx_v_one8;
19029 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19030 __Pyx_Buffer __pyx_pybuffer_v;
19031 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19032 __Pyx_Buffer __pyx_pybuffer_x;
19033 PyObject *__pyx_r = NULL;
19034 __Pyx_RefNannyDeclarations
19035 npy_intp __pyx_t_1;
19037 npy_intp __pyx_t_3;
19039 Py_ssize_t __pyx_t_5;
19040 Py_ssize_t __pyx_t_6;
19041 Py_ssize_t __pyx_t_7;
19043 Py_ssize_t __pyx_t_9;
19044 Py_ssize_t __pyx_t_10;
19045 Py_ssize_t __pyx_t_11;
19046 Py_ssize_t __pyx_t_12;
19047 Py_ssize_t __pyx_t_13;
19048 Py_ssize_t __pyx_t_14;
19049 Py_ssize_t __pyx_t_15;
19050 Py_ssize_t __pyx_t_16;
19051 Py_ssize_t __pyx_t_17;
19052 Py_ssize_t __pyx_t_18;
19053 Py_ssize_t __pyx_t_19;
19054 Py_ssize_t __pyx_t_20;
19055 Py_ssize_t __pyx_t_21;
19056 Py_ssize_t __pyx_t_22;
19057 Py_ssize_t __pyx_t_23;
19058 Py_ssize_t __pyx_t_24;
19059 Py_ssize_t __pyx_t_25;
19060 Py_ssize_t __pyx_t_26;
19061 Py_ssize_t __pyx_t_27;
19062 Py_ssize_t __pyx_t_28;
19063 Py_ssize_t __pyx_t_29;
19064 int __pyx_lineno = 0;
19065 const char *__pyx_filename = NULL;
19066 int __pyx_clineno = 0;
19067 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval3", 0);
19068 __pyx_pybuffer_x.pybuffer.buf = NULL;
19069 __pyx_pybuffer_x.refcount = 0;
19070 __pyx_pybuffernd_x.data = NULL;
19071 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19072 __pyx_pybuffer_v.pybuffer.buf = NULL;
19073 __pyx_pybuffer_v.refcount = 0;
19074 __pyx_pybuffernd_v.data = NULL;
19075 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19077 __Pyx_BufFmt_StackElem __pyx_stack[1];
19078 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19080 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2];
19082 __Pyx_BufFmt_StackElem __pyx_stack[1];
19083 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 3, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19085 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2];
19103 __pyx_v_one8 = (1.0 / 8.0);
19112 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
19113 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
19114 __pyx_v_eN = __pyx_t_2;
19123 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
19124 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19125 __pyx_v_k = __pyx_t_4;
19134 __pyx_t_5 = __pyx_v_eN;
19135 __pyx_t_6 = __pyx_v_k;
19138 if (__pyx_t_5 < 0) {
19139 __pyx_t_5 += __pyx_pybuffernd_x.diminfo[0].shape;
19140 if (unlikely(__pyx_t_5 < 0)) __pyx_t_8 = 0;
19141 }
else if (unlikely(__pyx_t_5 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19142 if (__pyx_t_6 < 0) {
19143 __pyx_t_6 += __pyx_pybuffernd_x.diminfo[1].shape;
19144 if (unlikely(__pyx_t_6 < 0)) __pyx_t_8 = 1;
19145 }
else if (unlikely(__pyx_t_6 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19146 if (__pyx_t_7 < 0) {
19147 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[2].shape;
19148 if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 2;
19149 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19150 if (unlikely(__pyx_t_8 != -1)) {
19151 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19152 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19154 __pyx_t_9 = __pyx_v_eN;
19155 __pyx_t_10 = __pyx_v_k;
19158 if (__pyx_t_9 < 0) {
19159 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[0].shape;
19160 if (unlikely(__pyx_t_9 < 0)) __pyx_t_8 = 0;
19161 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19162 if (__pyx_t_10 < 0) {
19163 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[1].shape;
19164 if (unlikely(__pyx_t_10 < 0)) __pyx_t_8 = 1;
19165 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19166 if (__pyx_t_11 < 0) {
19167 __pyx_t_11 += __pyx_pybuffernd_x.diminfo[2].shape;
19168 if (unlikely(__pyx_t_11 < 0)) __pyx_t_8 = 2;
19169 }
else if (unlikely(__pyx_t_11 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19170 if (unlikely(__pyx_t_8 != -1)) {
19171 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19172 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19174 __pyx_t_12 = __pyx_v_eN;
19175 __pyx_t_13 = __pyx_v_k;
19178 if (__pyx_t_12 < 0) {
19179 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[0].shape;
19180 if (unlikely(__pyx_t_12 < 0)) __pyx_t_8 = 0;
19181 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19182 if (__pyx_t_13 < 0) {
19183 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19184 if (unlikely(__pyx_t_13 < 0)) __pyx_t_8 = 1;
19185 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19186 if (__pyx_t_14 < 0) {
19187 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
19188 if (unlikely(__pyx_t_14 < 0)) __pyx_t_8 = 2;
19189 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19190 if (unlikely(__pyx_t_8 != -1)) {
19191 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19192 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19194 __pyx_t_15 = __pyx_v_eN;
19195 __pyx_t_16 = __pyx_v_k;
19198 if (__pyx_t_15 < 0) {
19199 __pyx_t_15 += __pyx_pybuffernd_v.diminfo[0].shape;
19200 if (unlikely(__pyx_t_15 < 0)) __pyx_t_8 = 0;
19201 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_8 = 0;
19202 if (__pyx_t_16 < 0) {
19203 __pyx_t_16 += __pyx_pybuffernd_v.diminfo[1].shape;
19204 if (unlikely(__pyx_t_16 < 0)) __pyx_t_8 = 1;
19205 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_8 = 1;
19206 if (__pyx_t_17 < 0) {
19207 __pyx_t_17 += __pyx_pybuffernd_v.diminfo[2].shape;
19208 if (unlikely(__pyx_t_17 < 0)) __pyx_t_8 = 2;
19209 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_8 = 2;
19210 if (unlikely(__pyx_t_8 != -1)) {
19211 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19212 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 920; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19214 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_15, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_16, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_17, __pyx_pybuffernd_v.diminfo[2].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_5, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_6, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_7, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_9, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_11, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides)))));
19223 __pyx_t_18 = __pyx_v_eN;
19224 __pyx_t_19 = __pyx_v_k;
19227 if (__pyx_t_18 < 0) {
19228 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[0].shape;
19229 if (unlikely(__pyx_t_18 < 0)) __pyx_t_8 = 0;
19230 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19231 if (__pyx_t_19 < 0) {
19232 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[1].shape;
19233 if (unlikely(__pyx_t_19 < 0)) __pyx_t_8 = 1;
19234 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19235 if (__pyx_t_20 < 0) {
19236 __pyx_t_20 += __pyx_pybuffernd_x.diminfo[2].shape;
19237 if (unlikely(__pyx_t_20 < 0)) __pyx_t_8 = 2;
19238 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19239 if (unlikely(__pyx_t_8 != -1)) {
19240 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19241 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19243 __pyx_t_21 = __pyx_v_eN;
19244 __pyx_t_22 = __pyx_v_k;
19247 if (__pyx_t_21 < 0) {
19248 __pyx_t_21 += __pyx_pybuffernd_x.diminfo[0].shape;
19249 if (unlikely(__pyx_t_21 < 0)) __pyx_t_8 = 0;
19250 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19251 if (__pyx_t_22 < 0) {
19252 __pyx_t_22 += __pyx_pybuffernd_x.diminfo[1].shape;
19253 if (unlikely(__pyx_t_22 < 0)) __pyx_t_8 = 1;
19254 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19255 if (__pyx_t_23 < 0) {
19256 __pyx_t_23 += __pyx_pybuffernd_x.diminfo[2].shape;
19257 if (unlikely(__pyx_t_23 < 0)) __pyx_t_8 = 2;
19258 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19259 if (unlikely(__pyx_t_8 != -1)) {
19260 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19261 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19263 __pyx_t_24 = __pyx_v_eN;
19264 __pyx_t_25 = __pyx_v_k;
19267 if (__pyx_t_24 < 0) {
19268 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[0].shape;
19269 if (unlikely(__pyx_t_24 < 0)) __pyx_t_8 = 0;
19270 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_8 = 0;
19271 if (__pyx_t_25 < 0) {
19272 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[1].shape;
19273 if (unlikely(__pyx_t_25 < 0)) __pyx_t_8 = 1;
19274 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_8 = 1;
19275 if (__pyx_t_26 < 0) {
19276 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[2].shape;
19277 if (unlikely(__pyx_t_26 < 0)) __pyx_t_8 = 2;
19278 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_8 = 2;
19279 if (unlikely(__pyx_t_8 != -1)) {
19280 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19281 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19283 __pyx_t_27 = __pyx_v_eN;
19284 __pyx_t_28 = __pyx_v_k;
19287 if (__pyx_t_27 < 0) {
19288 __pyx_t_27 += __pyx_pybuffernd_v.diminfo[0].shape;
19289 if (unlikely(__pyx_t_27 < 0)) __pyx_t_8 = 0;
19290 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_8 = 0;
19291 if (__pyx_t_28 < 0) {
19292 __pyx_t_28 += __pyx_pybuffernd_v.diminfo[1].shape;
19293 if (unlikely(__pyx_t_28 < 0)) __pyx_t_8 = 1;
19294 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_8 = 1;
19295 if (__pyx_t_29 < 0) {
19296 __pyx_t_29 += __pyx_pybuffernd_v.diminfo[2].shape;
19297 if (unlikely(__pyx_t_29 < 0)) __pyx_t_8 = 2;
19298 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_8 = 2;
19299 if (unlikely(__pyx_t_8 != -1)) {
19300 __Pyx_RaiseBufferIndexError(__pyx_t_8);
19301 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 921; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19303 *__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_27, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_28, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_29, __pyx_pybuffernd_v.diminfo[2].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_18, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_20, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_21, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_22, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_23, __pyx_pybuffernd_x.diminfo[2].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided3d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_x.diminfo[2].strides)))));
19316 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19319 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19320 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19321 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19322 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19323 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19324 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval3", __pyx_clineno, __pyx_lineno, __pyx_filename);
19328 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19329 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19331 __Pyx_XGIVEREF(__pyx_r);
19332 __Pyx_RefNannyFinishContext();
19345 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds);
19346 static PyMethodDef __pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4 = {
"vortexElementVelocityEval4", (PyCFunction)__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, METH_VARARGS|METH_KEYWORDS, 0};
19347 static PyObject *__pyx_pw_28subsurfaceTransportFunctions_57vortexElementVelocityEval4(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
19349 PyArrayObject *__pyx_v_x = 0;
19350 PyArrayObject *__pyx_v_v = 0;
19351 int __pyx_lineno = 0;
19352 const char *__pyx_filename = NULL;
19353 int __pyx_clineno = 0;
19354 PyObject *__pyx_r = 0;
19355 __Pyx_RefNannyDeclarations
19356 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4 (wrapper)", 0);
19358 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_t,&__pyx_n_s_x,&__pyx_n_s_v,0};
19359 PyObject* values[3] = {0,0,0};
19360 if (unlikely(__pyx_kwds)) {
19361 Py_ssize_t kw_args;
19362 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
19363 switch (pos_args) {
19364 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19365 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19366 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19368 default:
goto __pyx_L5_argtuple_error;
19370 kw_args = PyDict_Size(__pyx_kwds);
19371 switch (pos_args) {
19373 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
19374 else goto __pyx_L5_argtuple_error;
19376 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
19378 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19381 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_v)) != 0)) kw_args--;
19383 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19386 if (unlikely(kw_args > 0)) {
19387 if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args,
"vortexElementVelocityEval4") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19389 }
else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
19390 goto __pyx_L5_argtuple_error;
19392 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
19393 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
19394 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
19396 __pyx_v_t = __pyx_PyFloat_AsDouble(values[0]);
if (unlikely((__pyx_v_t == (
double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19397 __pyx_v_x = ((PyArrayObject *)values[1]);
19398 __pyx_v_v = ((PyArrayObject *)values[2]);
19400 goto __pyx_L4_argument_unpacking_done;
19401 __pyx_L5_argtuple_error:;
19402 __Pyx_RaiseArgtupleInvalid(
"vortexElementVelocityEval4", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L3_error;}
19404 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19405 __Pyx_RefNannyFinishContext();
19407 __pyx_L4_argument_unpacking_done:;
19408 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_x), __pyx_ptype_5numpy_ndarray, 1,
"x", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19409 if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_v), __pyx_ptype_5numpy_ndarray, 1,
"v", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 926; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19410 __pyx_r = __pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(__pyx_self, __pyx_v_t, __pyx_v_x, __pyx_v_v);
19417 __Pyx_RefNannyFinishContext();
19421 static PyObject *__pyx_pf_28subsurfaceTransportFunctions_56vortexElementVelocityEval4(CYTHON_UNUSED PyObject *__pyx_self,
double __pyx_v_t, PyArrayObject *__pyx_v_x, PyArrayObject *__pyx_v_v) {
19426 double __pyx_v_one8;
19427 __Pyx_LocalBuf_ND __pyx_pybuffernd_v;
19428 __Pyx_Buffer __pyx_pybuffer_v;
19429 __Pyx_LocalBuf_ND __pyx_pybuffernd_x;
19430 __Pyx_Buffer __pyx_pybuffer_x;
19431 PyObject *__pyx_r = NULL;
19432 __Pyx_RefNannyDeclarations
19433 npy_intp __pyx_t_1;
19435 npy_intp __pyx_t_3;
19437 npy_intp __pyx_t_5;
19439 Py_ssize_t __pyx_t_7;
19440 Py_ssize_t __pyx_t_8;
19441 Py_ssize_t __pyx_t_9;
19442 Py_ssize_t __pyx_t_10;
19444 Py_ssize_t __pyx_t_12;
19445 Py_ssize_t __pyx_t_13;
19446 Py_ssize_t __pyx_t_14;
19447 Py_ssize_t __pyx_t_15;
19448 Py_ssize_t __pyx_t_16;
19449 Py_ssize_t __pyx_t_17;
19450 Py_ssize_t __pyx_t_18;
19451 Py_ssize_t __pyx_t_19;
19452 Py_ssize_t __pyx_t_20;
19453 Py_ssize_t __pyx_t_21;
19454 Py_ssize_t __pyx_t_22;
19455 Py_ssize_t __pyx_t_23;
19456 Py_ssize_t __pyx_t_24;
19457 Py_ssize_t __pyx_t_25;
19458 Py_ssize_t __pyx_t_26;
19459 Py_ssize_t __pyx_t_27;
19460 Py_ssize_t __pyx_t_28;
19461 Py_ssize_t __pyx_t_29;
19462 Py_ssize_t __pyx_t_30;
19463 Py_ssize_t __pyx_t_31;
19464 Py_ssize_t __pyx_t_32;
19465 Py_ssize_t __pyx_t_33;
19466 Py_ssize_t __pyx_t_34;
19467 Py_ssize_t __pyx_t_35;
19468 Py_ssize_t __pyx_t_36;
19469 Py_ssize_t __pyx_t_37;
19470 Py_ssize_t __pyx_t_38;
19471 Py_ssize_t __pyx_t_39;
19472 int __pyx_lineno = 0;
19473 const char *__pyx_filename = NULL;
19474 int __pyx_clineno = 0;
19475 __Pyx_RefNannySetupContext(
"vortexElementVelocityEval4", 0);
19476 __pyx_pybuffer_x.pybuffer.buf = NULL;
19477 __pyx_pybuffer_x.refcount = 0;
19478 __pyx_pybuffernd_x.data = NULL;
19479 __pyx_pybuffernd_x.rcbuffer = &__pyx_pybuffer_x;
19480 __pyx_pybuffer_v.pybuffer.buf = NULL;
19481 __pyx_pybuffer_v.refcount = 0;
19482 __pyx_pybuffernd_v.data = NULL;
19483 __pyx_pybuffernd_v.rcbuffer = &__pyx_pybuffer_v;
19485 __Pyx_BufFmt_StackElem __pyx_stack[1];
19486 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_x.rcbuffer->pybuffer, (PyObject*)__pyx_v_x, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19488 __pyx_pybuffernd_x.diminfo[0].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_x.diminfo[0].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_x.diminfo[1].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_x.diminfo[1].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_x.diminfo[2].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_x.diminfo[2].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_x.diminfo[3].strides = __pyx_pybuffernd_x.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_x.diminfo[3].shape = __pyx_pybuffernd_x.rcbuffer->pybuffer.shape[3];
19490 __Pyx_BufFmt_StackElem __pyx_stack[1];
19491 if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_v.rcbuffer->pybuffer, (PyObject*)__pyx_v_v, &__Pyx_TypeInfo_nn___pyx_t_28subsurfaceTransportFunctions_DTYPE_t, PyBUF_FORMAT| PyBUF_STRIDES| PyBUF_WRITABLE, 4, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19493 __pyx_pybuffernd_v.diminfo[0].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_v.diminfo[0].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_v.diminfo[1].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_v.diminfo[1].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[1]; __pyx_pybuffernd_v.diminfo[2].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[2]; __pyx_pybuffernd_v.diminfo[2].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[2]; __pyx_pybuffernd_v.diminfo[3].strides = __pyx_pybuffernd_v.rcbuffer->pybuffer.strides[3]; __pyx_pybuffernd_v.diminfo[3].shape = __pyx_pybuffernd_v.rcbuffer->pybuffer.shape[3];
19511 __pyx_v_one8 = (1.0 / 8.0);
19520 __pyx_t_1 = (__pyx_v_x->dimensions[0]);
19521 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
19522 __pyx_v_eN = __pyx_t_2;
19531 __pyx_t_3 = (__pyx_v_x->dimensions[1]);
19532 for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19533 __pyx_v_ebN = __pyx_t_4;
19542 __pyx_t_5 = (__pyx_v_x->dimensions[2]);
19543 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
19544 __pyx_v_k = __pyx_t_6;
19553 __pyx_t_7 = __pyx_v_eN;
19554 __pyx_t_8 = __pyx_v_ebN;
19555 __pyx_t_9 = __pyx_v_k;
19558 if (__pyx_t_7 < 0) {
19559 __pyx_t_7 += __pyx_pybuffernd_x.diminfo[0].shape;
19560 if (unlikely(__pyx_t_7 < 0)) __pyx_t_11 = 0;
19561 }
else if (unlikely(__pyx_t_7 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19562 if (__pyx_t_8 < 0) {
19563 __pyx_t_8 += __pyx_pybuffernd_x.diminfo[1].shape;
19564 if (unlikely(__pyx_t_8 < 0)) __pyx_t_11 = 1;
19565 }
else if (unlikely(__pyx_t_8 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19566 if (__pyx_t_9 < 0) {
19567 __pyx_t_9 += __pyx_pybuffernd_x.diminfo[2].shape;
19568 if (unlikely(__pyx_t_9 < 0)) __pyx_t_11 = 2;
19569 }
else if (unlikely(__pyx_t_9 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19570 if (__pyx_t_10 < 0) {
19571 __pyx_t_10 += __pyx_pybuffernd_x.diminfo[3].shape;
19572 if (unlikely(__pyx_t_10 < 0)) __pyx_t_11 = 3;
19573 }
else if (unlikely(__pyx_t_10 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19574 if (unlikely(__pyx_t_11 != -1)) {
19575 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19576 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19578 __pyx_t_12 = __pyx_v_eN;
19579 __pyx_t_13 = __pyx_v_ebN;
19580 __pyx_t_14 = __pyx_v_k;
19583 if (__pyx_t_12 < 0) {
19584 __pyx_t_12 += __pyx_pybuffernd_x.diminfo[0].shape;
19585 if (unlikely(__pyx_t_12 < 0)) __pyx_t_11 = 0;
19586 }
else if (unlikely(__pyx_t_12 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19587 if (__pyx_t_13 < 0) {
19588 __pyx_t_13 += __pyx_pybuffernd_x.diminfo[1].shape;
19589 if (unlikely(__pyx_t_13 < 0)) __pyx_t_11 = 1;
19590 }
else if (unlikely(__pyx_t_13 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19591 if (__pyx_t_14 < 0) {
19592 __pyx_t_14 += __pyx_pybuffernd_x.diminfo[2].shape;
19593 if (unlikely(__pyx_t_14 < 0)) __pyx_t_11 = 2;
19594 }
else if (unlikely(__pyx_t_14 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19595 if (__pyx_t_15 < 0) {
19596 __pyx_t_15 += __pyx_pybuffernd_x.diminfo[3].shape;
19597 if (unlikely(__pyx_t_15 < 0)) __pyx_t_11 = 3;
19598 }
else if (unlikely(__pyx_t_15 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19599 if (unlikely(__pyx_t_11 != -1)) {
19600 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19601 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19603 __pyx_t_16 = __pyx_v_eN;
19604 __pyx_t_17 = __pyx_v_ebN;
19605 __pyx_t_18 = __pyx_v_k;
19608 if (__pyx_t_16 < 0) {
19609 __pyx_t_16 += __pyx_pybuffernd_x.diminfo[0].shape;
19610 if (unlikely(__pyx_t_16 < 0)) __pyx_t_11 = 0;
19611 }
else if (unlikely(__pyx_t_16 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19612 if (__pyx_t_17 < 0) {
19613 __pyx_t_17 += __pyx_pybuffernd_x.diminfo[1].shape;
19614 if (unlikely(__pyx_t_17 < 0)) __pyx_t_11 = 1;
19615 }
else if (unlikely(__pyx_t_17 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19616 if (__pyx_t_18 < 0) {
19617 __pyx_t_18 += __pyx_pybuffernd_x.diminfo[2].shape;
19618 if (unlikely(__pyx_t_18 < 0)) __pyx_t_11 = 2;
19619 }
else if (unlikely(__pyx_t_18 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19620 if (__pyx_t_19 < 0) {
19621 __pyx_t_19 += __pyx_pybuffernd_x.diminfo[3].shape;
19622 if (unlikely(__pyx_t_19 < 0)) __pyx_t_11 = 3;
19623 }
else if (unlikely(__pyx_t_19 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19624 if (unlikely(__pyx_t_11 != -1)) {
19625 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19626 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19628 __pyx_t_20 = __pyx_v_eN;
19629 __pyx_t_21 = __pyx_v_ebN;
19630 __pyx_t_22 = __pyx_v_k;
19633 if (__pyx_t_20 < 0) {
19634 __pyx_t_20 += __pyx_pybuffernd_v.diminfo[0].shape;
19635 if (unlikely(__pyx_t_20 < 0)) __pyx_t_11 = 0;
19636 }
else if (unlikely(__pyx_t_20 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19637 if (__pyx_t_21 < 0) {
19638 __pyx_t_21 += __pyx_pybuffernd_v.diminfo[1].shape;
19639 if (unlikely(__pyx_t_21 < 0)) __pyx_t_11 = 1;
19640 }
else if (unlikely(__pyx_t_21 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19641 if (__pyx_t_22 < 0) {
19642 __pyx_t_22 += __pyx_pybuffernd_v.diminfo[2].shape;
19643 if (unlikely(__pyx_t_22 < 0)) __pyx_t_11 = 2;
19644 }
else if (unlikely(__pyx_t_22 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19645 if (__pyx_t_23 < 0) {
19646 __pyx_t_23 += __pyx_pybuffernd_v.diminfo[3].shape;
19647 if (unlikely(__pyx_t_23 < 0)) __pyx_t_11 = 3;
19648 }
else if (unlikely(__pyx_t_23 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_11 = 3;
19649 if (unlikely(__pyx_t_11 != -1)) {
19650 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19651 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 934; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19653 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_20, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_21, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_22, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_23, __pyx_pybuffernd_v.diminfo[3].strides) = (((cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t)) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_7, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_8, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_9, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_10, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_13, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_14, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_15, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_16, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_17, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_18, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_19, __pyx_pybuffernd_x.diminfo[3].strides)))));
19662 __pyx_t_24 = __pyx_v_eN;
19663 __pyx_t_25 = __pyx_v_ebN;
19664 __pyx_t_26 = __pyx_v_k;
19667 if (__pyx_t_24 < 0) {
19668 __pyx_t_24 += __pyx_pybuffernd_x.diminfo[0].shape;
19669 if (unlikely(__pyx_t_24 < 0)) __pyx_t_11 = 0;
19670 }
else if (unlikely(__pyx_t_24 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19671 if (__pyx_t_25 < 0) {
19672 __pyx_t_25 += __pyx_pybuffernd_x.diminfo[1].shape;
19673 if (unlikely(__pyx_t_25 < 0)) __pyx_t_11 = 1;
19674 }
else if (unlikely(__pyx_t_25 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19675 if (__pyx_t_26 < 0) {
19676 __pyx_t_26 += __pyx_pybuffernd_x.diminfo[2].shape;
19677 if (unlikely(__pyx_t_26 < 0)) __pyx_t_11 = 2;
19678 }
else if (unlikely(__pyx_t_26 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19679 if (__pyx_t_27 < 0) {
19680 __pyx_t_27 += __pyx_pybuffernd_x.diminfo[3].shape;
19681 if (unlikely(__pyx_t_27 < 0)) __pyx_t_11 = 3;
19682 }
else if (unlikely(__pyx_t_27 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19683 if (unlikely(__pyx_t_11 != -1)) {
19684 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19685 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19687 __pyx_t_28 = __pyx_v_eN;
19688 __pyx_t_29 = __pyx_v_ebN;
19689 __pyx_t_30 = __pyx_v_k;
19692 if (__pyx_t_28 < 0) {
19693 __pyx_t_28 += __pyx_pybuffernd_x.diminfo[0].shape;
19694 if (unlikely(__pyx_t_28 < 0)) __pyx_t_11 = 0;
19695 }
else if (unlikely(__pyx_t_28 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19696 if (__pyx_t_29 < 0) {
19697 __pyx_t_29 += __pyx_pybuffernd_x.diminfo[1].shape;
19698 if (unlikely(__pyx_t_29 < 0)) __pyx_t_11 = 1;
19699 }
else if (unlikely(__pyx_t_29 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19700 if (__pyx_t_30 < 0) {
19701 __pyx_t_30 += __pyx_pybuffernd_x.diminfo[2].shape;
19702 if (unlikely(__pyx_t_30 < 0)) __pyx_t_11 = 2;
19703 }
else if (unlikely(__pyx_t_30 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19704 if (__pyx_t_31 < 0) {
19705 __pyx_t_31 += __pyx_pybuffernd_x.diminfo[3].shape;
19706 if (unlikely(__pyx_t_31 < 0)) __pyx_t_11 = 3;
19707 }
else if (unlikely(__pyx_t_31 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19708 if (unlikely(__pyx_t_11 != -1)) {
19709 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19710 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19712 __pyx_t_32 = __pyx_v_eN;
19713 __pyx_t_33 = __pyx_v_ebN;
19714 __pyx_t_34 = __pyx_v_k;
19717 if (__pyx_t_32 < 0) {
19718 __pyx_t_32 += __pyx_pybuffernd_x.diminfo[0].shape;
19719 if (unlikely(__pyx_t_32 < 0)) __pyx_t_11 = 0;
19720 }
else if (unlikely(__pyx_t_32 >= __pyx_pybuffernd_x.diminfo[0].shape)) __pyx_t_11 = 0;
19721 if (__pyx_t_33 < 0) {
19722 __pyx_t_33 += __pyx_pybuffernd_x.diminfo[1].shape;
19723 if (unlikely(__pyx_t_33 < 0)) __pyx_t_11 = 1;
19724 }
else if (unlikely(__pyx_t_33 >= __pyx_pybuffernd_x.diminfo[1].shape)) __pyx_t_11 = 1;
19725 if (__pyx_t_34 < 0) {
19726 __pyx_t_34 += __pyx_pybuffernd_x.diminfo[2].shape;
19727 if (unlikely(__pyx_t_34 < 0)) __pyx_t_11 = 2;
19728 }
else if (unlikely(__pyx_t_34 >= __pyx_pybuffernd_x.diminfo[2].shape)) __pyx_t_11 = 2;
19729 if (__pyx_t_35 < 0) {
19730 __pyx_t_35 += __pyx_pybuffernd_x.diminfo[3].shape;
19731 if (unlikely(__pyx_t_35 < 0)) __pyx_t_11 = 3;
19732 }
else if (unlikely(__pyx_t_35 >= __pyx_pybuffernd_x.diminfo[3].shape)) __pyx_t_11 = 3;
19733 if (unlikely(__pyx_t_11 != -1)) {
19734 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19735 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19737 __pyx_t_36 = __pyx_v_eN;
19738 __pyx_t_37 = __pyx_v_ebN;
19739 __pyx_t_38 = __pyx_v_k;
19742 if (__pyx_t_36 < 0) {
19743 __pyx_t_36 += __pyx_pybuffernd_v.diminfo[0].shape;
19744 if (unlikely(__pyx_t_36 < 0)) __pyx_t_11 = 0;
19745 }
else if (unlikely(__pyx_t_36 >= __pyx_pybuffernd_v.diminfo[0].shape)) __pyx_t_11 = 0;
19746 if (__pyx_t_37 < 0) {
19747 __pyx_t_37 += __pyx_pybuffernd_v.diminfo[1].shape;
19748 if (unlikely(__pyx_t_37 < 0)) __pyx_t_11 = 1;
19749 }
else if (unlikely(__pyx_t_37 >= __pyx_pybuffernd_v.diminfo[1].shape)) __pyx_t_11 = 1;
19750 if (__pyx_t_38 < 0) {
19751 __pyx_t_38 += __pyx_pybuffernd_v.diminfo[2].shape;
19752 if (unlikely(__pyx_t_38 < 0)) __pyx_t_11 = 2;
19753 }
else if (unlikely(__pyx_t_38 >= __pyx_pybuffernd_v.diminfo[2].shape)) __pyx_t_11 = 2;
19754 if (__pyx_t_39 < 0) {
19755 __pyx_t_39 += __pyx_pybuffernd_v.diminfo[3].shape;
19756 if (unlikely(__pyx_t_39 < 0)) __pyx_t_11 = 3;
19757 }
else if (unlikely(__pyx_t_39 >= __pyx_pybuffernd_v.diminfo[3].shape)) __pyx_t_11 = 3;
19758 if (unlikely(__pyx_t_11 != -1)) {
19759 __Pyx_RaiseBufferIndexError(__pyx_t_11);
19760 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19762 *__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_v.rcbuffer->pybuffer.buf, __pyx_t_36, __pyx_pybuffernd_v.diminfo[0].strides, __pyx_t_37, __pyx_pybuffernd_v.diminfo[1].strides, __pyx_t_38, __pyx_pybuffernd_v.diminfo[2].strides, __pyx_t_39, __pyx_pybuffernd_v.diminfo[3].strides) = ((((-cos(((__pyx_v_pi * __pyx_v_one8) * __pyx_v_t))) * sin(((2.0 * __pyx_v_pi) * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_24, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_25, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_26, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_27, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_28, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_29, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_30, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_31, __pyx_pybuffernd_x.diminfo[3].strides))))) * sin((__pyx_v_pi * (*__Pyx_BufPtrStrided4d(__pyx_t_28subsurfaceTransportFunctions_DTYPE_t *, __pyx_pybuffernd_x.rcbuffer->pybuffer.buf, __pyx_t_32, __pyx_pybuffernd_x.diminfo[0].strides, __pyx_t_33, __pyx_pybuffernd_x.diminfo[1].strides, __pyx_t_34, __pyx_pybuffernd_x.diminfo[2].strides, __pyx_t_35, __pyx_pybuffernd_x.diminfo[3].strides)))));
19776 __pyx_r = Py_None; __Pyx_INCREF(Py_None);
19779 { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
19780 __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
19781 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19782 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19783 __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
19784 __Pyx_AddTraceback(
"subsurfaceTransportFunctions.vortexElementVelocityEval4", __pyx_clineno, __pyx_lineno, __pyx_filename);
19788 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_v.rcbuffer->pybuffer);
19789 __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_x.rcbuffer->pybuffer);
19791 __Pyx_XGIVEREF(__pyx_r);
19792 __Pyx_RefNannyFinishContext();
19805 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags);
19806 static CYTHON_UNUSED
int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
19808 __Pyx_RefNannyDeclarations
19809 __Pyx_RefNannySetupContext(
"__getbuffer__ (wrapper)", 0);
19810 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((
int)__pyx_v_flags));
19813 __Pyx_RefNannyFinishContext();
19817 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info,
int __pyx_v_flags) {
19818 int __pyx_v_copy_shape;
19821 int __pyx_v_endian_detector;
19822 int __pyx_v_little_endian;
19825 PyArray_Descr *__pyx_v_descr = 0;
19826 int __pyx_v_offset;
19827 int __pyx_v_hasfields;
19829 __Pyx_RefNannyDeclarations
19832 PyObject *__pyx_t_3 = NULL;
19835 PyObject *__pyx_t_6 = NULL;
19837 int __pyx_lineno = 0;
19838 const char *__pyx_filename = NULL;
19839 int __pyx_clineno = 0;
19840 __Pyx_RefNannySetupContext(
"__getbuffer__", 0);
19841 if (__pyx_v_info != NULL) {
19842 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
19843 __Pyx_GIVEREF(__pyx_v_info->obj);
19853 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
19866 __pyx_v_endian_detector = 1;
19875 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
19884 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
19893 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
19903 __pyx_v_copy_shape = 1;
19923 __pyx_v_copy_shape = 0;
19934 __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
19937 __pyx_t_1 = __pyx_t_2;
19938 goto __pyx_L6_bool_binop_done;
19948 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
19949 __pyx_t_1 = __pyx_t_2;
19950 __pyx_L6_bool_binop_done:;
19968 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19969 __Pyx_GOTREF(__pyx_t_3);
19970 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
19971 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19972 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
19990 __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
19993 __pyx_t_1 = __pyx_t_2;
19994 goto __pyx_L9_bool_binop_done;
20004 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
20005 __pyx_t_1 = __pyx_t_2;
20006 __pyx_L9_bool_binop_done:;
20024 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20025 __Pyx_GOTREF(__pyx_t_3);
20026 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20027 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20028 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20046 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
20055 __pyx_v_info->ndim = __pyx_v_ndim;
20064 __pyx_t_1 = (__pyx_v_copy_shape != 0);
20074 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((
sizeof(Py_ssize_t)) * ((
size_t)__pyx_v_ndim)) * 2)));
20083 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
20092 __pyx_t_4 = __pyx_v_ndim;
20093 for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
20094 __pyx_v_i = __pyx_t_5;
20103 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
20112 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
20133 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
20142 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
20153 __pyx_v_info->suboffsets = NULL;
20162 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
20171 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
20189 __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
20190 __Pyx_INCREF(__pyx_t_3);
20191 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
20201 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
20210 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
20213 __pyx_t_1 = __pyx_t_2;
20214 goto __pyx_L15_bool_binop_done;
20216 __pyx_t_2 = ((!(__pyx_v_copy_shape != 0)) != 0);
20217 __pyx_t_1 = __pyx_t_2;
20218 __pyx_L15_bool_binop_done:;
20228 __Pyx_INCREF(Py_None);
20229 __Pyx_GIVEREF(Py_None);
20230 __Pyx_GOTREF(__pyx_v_info->obj);
20231 __Pyx_DECREF(__pyx_v_info->obj);
20232 __pyx_v_info->obj = Py_None;
20252 __Pyx_INCREF(((PyObject *)__pyx_v_self));
20253 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
20254 __Pyx_GOTREF(__pyx_v_info->obj);
20255 __Pyx_DECREF(__pyx_v_info->obj);
20256 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
20267 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
20277 __pyx_t_4 = __pyx_v_descr->type_num;
20278 __pyx_v_t = __pyx_t_4;
20287 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'>') != 0);
20289 goto __pyx_L20_next_or;
20292 __pyx_t_2 = (__pyx_v_little_endian != 0);
20295 __pyx_t_1 = __pyx_t_2;
20296 goto __pyx_L19_bool_binop_done;
20298 __pyx_L20_next_or:;
20307 __pyx_t_2 = ((__pyx_v_descr->byteorder ==
'<') != 0);
20310 __pyx_t_1 = __pyx_t_2;
20311 goto __pyx_L19_bool_binop_done;
20313 __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
20314 __pyx_t_1 = __pyx_t_2;
20315 __pyx_L19_bool_binop_done:;
20333 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20334 __Pyx_GOTREF(__pyx_t_3);
20335 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20336 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20337 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20355 switch (__pyx_v_t) {
20357 __pyx_v_f = __pyx_k_b;
20368 __pyx_v_f = __pyx_k_B;
20379 __pyx_v_f = __pyx_k_h;
20390 __pyx_v_f = __pyx_k_H;
20401 __pyx_v_f = __pyx_k_i;
20412 __pyx_v_f = __pyx_k_I;
20423 __pyx_v_f = __pyx_k_l;
20434 __pyx_v_f = __pyx_k_L;
20445 __pyx_v_f = __pyx_k_q;
20455 case NPY_ULONGLONG:
20456 __pyx_v_f = __pyx_k_Q;
20467 __pyx_v_f = __pyx_k_f;
20478 __pyx_v_f = __pyx_k_d;
20488 case NPY_LONGDOUBLE:
20489 __pyx_v_f = __pyx_k_g;
20500 __pyx_v_f = __pyx_k_Zf;
20511 __pyx_v_f = __pyx_k_Zd;
20521 case NPY_CLONGDOUBLE:
20522 __pyx_v_f = __pyx_k_Zg;
20533 __pyx_v_f = __pyx_k_O;
20544 __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20545 __Pyx_GOTREF(__pyx_t_3);
20546 __pyx_t_6 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20547 __Pyx_GOTREF(__pyx_t_6);
20548 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20549 __pyx_t_3 = PyTuple_New(1);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20550 __Pyx_GOTREF(__pyx_t_3);
20551 __Pyx_GIVEREF(__pyx_t_6);
20552 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
20554 __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_3, NULL);
if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20555 __Pyx_GOTREF(__pyx_t_6);
20556 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20557 __Pyx_Raise(__pyx_t_6, 0, 0, 0);
20558 __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20559 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 278; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20570 __pyx_v_info->format = __pyx_v_f;
20599 __pyx_v_info->format = ((
char *)malloc(0xFF));
20608 (__pyx_v_info->format[0]) =
'^';
20617 __pyx_v_offset = 0;
20626 __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset));
if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 285; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20627 __pyx_v_f = __pyx_t_7;
20636 (__pyx_v_f[0]) =
'\x00';
20651 __Pyx_XDECREF(__pyx_t_3);
20652 __Pyx_XDECREF(__pyx_t_6);
20653 __Pyx_AddTraceback(
"numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
20655 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
20656 __Pyx_GOTREF(__pyx_v_info->obj);
20657 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
20661 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
20662 __Pyx_GOTREF(Py_None);
20663 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
20666 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
20667 __Pyx_RefNannyFinishContext();
20680 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info);
20681 static CYTHON_UNUSED
void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
20682 __Pyx_RefNannyDeclarations
20683 __Pyx_RefNannySetupContext(
"__releasebuffer__ (wrapper)", 0);
20684 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
20687 __Pyx_RefNannyFinishContext();
20690 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
20691 __Pyx_RefNannyDeclarations
20693 __Pyx_RefNannySetupContext(
"__releasebuffer__", 0);
20702 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
20712 free(__pyx_v_info->format);
20730 __pyx_t_1 = (((
sizeof(npy_intp)) != (
sizeof(Py_ssize_t))) != 0);
20740 free(__pyx_v_info->strides);
20760 __Pyx_RefNannyFinishContext();
20771 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
20772 PyObject *__pyx_r = NULL;
20773 __Pyx_RefNannyDeclarations
20774 PyObject *__pyx_t_1 = NULL;
20775 int __pyx_lineno = 0;
20776 const char *__pyx_filename = NULL;
20777 int __pyx_clineno = 0;
20778 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew1", 0);
20787 __Pyx_XDECREF(__pyx_r);
20788 __pyx_t_1 = PyArray_MultiIterNew(1, ((
void *)__pyx_v_a));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 771; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20789 __Pyx_GOTREF(__pyx_t_1);
20790 __pyx_r = __pyx_t_1;
20804 __Pyx_XDECREF(__pyx_t_1);
20805 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
20808 __Pyx_XGIVEREF(__pyx_r);
20809 __Pyx_RefNannyFinishContext();
20821 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
20822 PyObject *__pyx_r = NULL;
20823 __Pyx_RefNannyDeclarations
20824 PyObject *__pyx_t_1 = NULL;
20825 int __pyx_lineno = 0;
20826 const char *__pyx_filename = NULL;
20827 int __pyx_clineno = 0;
20828 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew2", 0);
20837 __Pyx_XDECREF(__pyx_r);
20838 __pyx_t_1 = PyArray_MultiIterNew(2, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 774; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20839 __Pyx_GOTREF(__pyx_t_1);
20840 __pyx_r = __pyx_t_1;
20854 __Pyx_XDECREF(__pyx_t_1);
20855 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
20858 __Pyx_XGIVEREF(__pyx_r);
20859 __Pyx_RefNannyFinishContext();
20871 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
20872 PyObject *__pyx_r = NULL;
20873 __Pyx_RefNannyDeclarations
20874 PyObject *__pyx_t_1 = NULL;
20875 int __pyx_lineno = 0;
20876 const char *__pyx_filename = NULL;
20877 int __pyx_clineno = 0;
20878 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew3", 0);
20887 __Pyx_XDECREF(__pyx_r);
20888 __pyx_t_1 = PyArray_MultiIterNew(3, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 777; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20889 __Pyx_GOTREF(__pyx_t_1);
20890 __pyx_r = __pyx_t_1;
20904 __Pyx_XDECREF(__pyx_t_1);
20905 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
20908 __Pyx_XGIVEREF(__pyx_r);
20909 __Pyx_RefNannyFinishContext();
20921 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
20922 PyObject *__pyx_r = NULL;
20923 __Pyx_RefNannyDeclarations
20924 PyObject *__pyx_t_1 = NULL;
20925 int __pyx_lineno = 0;
20926 const char *__pyx_filename = NULL;
20927 int __pyx_clineno = 0;
20928 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew4", 0);
20937 __Pyx_XDECREF(__pyx_r);
20938 __pyx_t_1 = PyArray_MultiIterNew(4, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 780; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20939 __Pyx_GOTREF(__pyx_t_1);
20940 __pyx_r = __pyx_t_1;
20954 __Pyx_XDECREF(__pyx_t_1);
20955 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
20958 __Pyx_XGIVEREF(__pyx_r);
20959 __Pyx_RefNannyFinishContext();
20971 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
20972 PyObject *__pyx_r = NULL;
20973 __Pyx_RefNannyDeclarations
20974 PyObject *__pyx_t_1 = NULL;
20975 int __pyx_lineno = 0;
20976 const char *__pyx_filename = NULL;
20977 int __pyx_clineno = 0;
20978 __Pyx_RefNannySetupContext(
"PyArray_MultiIterNew5", 0);
20987 __Pyx_XDECREF(__pyx_r);
20988 __pyx_t_1 = PyArray_MultiIterNew(5, ((
void *)__pyx_v_a), ((
void *)__pyx_v_b), ((
void *)__pyx_v_c), ((
void *)__pyx_v_d), ((
void *)__pyx_v_e));
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 783; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
20989 __Pyx_GOTREF(__pyx_t_1);
20990 __pyx_r = __pyx_t_1;
21004 __Pyx_XDECREF(__pyx_t_1);
21005 __Pyx_AddTraceback(
"numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
21008 __Pyx_XGIVEREF(__pyx_r);
21009 __Pyx_RefNannyFinishContext();
21021 static CYTHON_INLINE
char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr,
char *__pyx_v_f,
char *__pyx_v_end,
int *__pyx_v_offset) {
21022 PyArray_Descr *__pyx_v_child = 0;
21023 int __pyx_v_endian_detector;
21024 int __pyx_v_little_endian;
21025 PyObject *__pyx_v_fields = 0;
21026 PyObject *__pyx_v_childname = NULL;
21027 PyObject *__pyx_v_new_offset = NULL;
21028 PyObject *__pyx_v_t = NULL;
21030 __Pyx_RefNannyDeclarations
21031 PyObject *__pyx_t_1 = NULL;
21032 Py_ssize_t __pyx_t_2;
21033 PyObject *__pyx_t_3 = NULL;
21034 PyObject *__pyx_t_4 = NULL;
21040 int __pyx_lineno = 0;
21041 const char *__pyx_filename = NULL;
21042 int __pyx_clineno = 0;
21043 __Pyx_RefNannySetupContext(
"_util_dtypestring", 0);
21052 __pyx_v_endian_detector = 1;
21061 __pyx_v_little_endian = ((((
char *)(&__pyx_v_endian_detector))[0]) != 0);
21070 if (unlikely(__pyx_v_descr->names == Py_None)) {
21071 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
21072 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21074 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
21076 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1))
break;
21077 #if CYTHON_COMPILING_IN_CPYTHON
21078 __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++;
if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21080 __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++;
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21081 __Pyx_GOTREF(__pyx_t_3);
21083 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
21093 if (unlikely(__pyx_v_descr->fields == Py_None)) {
21094 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not subscriptable");
21095 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21097 __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname);
if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
21098 __Pyx_GOTREF(__pyx_t_3);
21099 if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError,
"Expected %.16s, got %.200s",
"tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21100 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
21110 if (likely(__pyx_v_fields != Py_None)) {
21111 PyObject* sequence = __pyx_v_fields;
21112 #if CYTHON_COMPILING_IN_CPYTHON
21113 Py_ssize_t size = Py_SIZE(sequence);
21115 Py_ssize_t size = PySequence_Size(sequence);
21117 if (unlikely(size != 2)) {
21118 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
21119 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
21120 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21122 #if CYTHON_COMPILING_IN_CPYTHON
21123 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
21124 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
21125 __Pyx_INCREF(__pyx_t_3);
21126 __Pyx_INCREF(__pyx_t_4);
21128 __pyx_t_3 = PySequence_ITEM(sequence, 0);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21129 __Pyx_GOTREF(__pyx_t_3);
21130 __pyx_t_4 = PySequence_ITEM(sequence, 1);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21131 __Pyx_GOTREF(__pyx_t_4);
21134 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21136 if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21137 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
21139 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
21149 __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21150 __Pyx_GOTREF(__pyx_t_4);
21151 __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21152 __Pyx_GOTREF(__pyx_t_3);
21153 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21154 __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3);
if (unlikely((__pyx_t_5 == (
int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21155 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21156 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((
int)__pyx_t_5)) < 15) != 0);
21166 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21167 __Pyx_GOTREF(__pyx_t_3);
21168 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21169 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21170 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21188 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'>') != 0);
21190 goto __pyx_L8_next_or;
21193 __pyx_t_7 = (__pyx_v_little_endian != 0);
21196 __pyx_t_6 = __pyx_t_7;
21197 goto __pyx_L7_bool_binop_done;
21208 __pyx_t_7 = ((__pyx_v_child->byteorder ==
'<') != 0);
21211 __pyx_t_6 = __pyx_t_7;
21212 goto __pyx_L7_bool_binop_done;
21214 __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
21215 __pyx_t_6 = __pyx_t_7;
21216 __pyx_L7_bool_binop_done:;
21234 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21235 __Pyx_GOTREF(__pyx_t_3);
21236 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21237 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21238 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21257 __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0]));
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21258 __Pyx_GOTREF(__pyx_t_3);
21259 __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21260 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21261 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21262 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21263 if (!__pyx_t_6)
break;
21272 (__pyx_v_f[0]) = 0x78;
21281 __pyx_v_f = (__pyx_v_f + 1);
21291 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
21302 (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
21311 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
21321 __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21322 __Pyx_GOTREF(__pyx_t_4);
21323 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
21333 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
21343 __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21344 __Pyx_GOTREF(__pyx_t_4);
21345 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
21346 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21347 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21365 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21366 __Pyx_GOTREF(__pyx_t_4);
21367 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21368 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21369 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21370 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21372 (__pyx_v_f[0]) = 98;
21383 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21384 __Pyx_GOTREF(__pyx_t_3);
21385 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21386 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21387 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21388 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21390 (__pyx_v_f[0]) = 66;
21401 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21402 __Pyx_GOTREF(__pyx_t_4);
21403 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21404 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21405 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21406 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21408 (__pyx_v_f[0]) = 0x68;
21419 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21420 __Pyx_GOTREF(__pyx_t_3);
21421 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21422 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21423 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21424 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21426 (__pyx_v_f[0]) = 72;
21437 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21438 __Pyx_GOTREF(__pyx_t_4);
21439 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21440 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21441 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21442 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21444 (__pyx_v_f[0]) = 0x69;
21455 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21456 __Pyx_GOTREF(__pyx_t_3);
21457 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21458 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21459 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21460 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21462 (__pyx_v_f[0]) = 73;
21473 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21474 __Pyx_GOTREF(__pyx_t_4);
21475 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21476 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21477 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21478 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21480 (__pyx_v_f[0]) = 0x6C;
21491 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21492 __Pyx_GOTREF(__pyx_t_3);
21493 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21494 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21495 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21496 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21498 (__pyx_v_f[0]) = 76;
21509 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21510 __Pyx_GOTREF(__pyx_t_4);
21511 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21512 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21513 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21514 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21516 (__pyx_v_f[0]) = 0x71;
21527 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21528 __Pyx_GOTREF(__pyx_t_3);
21529 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21530 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21531 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21532 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21534 (__pyx_v_f[0]) = 81;
21545 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21546 __Pyx_GOTREF(__pyx_t_4);
21547 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21548 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21549 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21550 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21552 (__pyx_v_f[0]) = 0x66;
21563 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21564 __Pyx_GOTREF(__pyx_t_3);
21565 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21566 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21567 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21568 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21570 (__pyx_v_f[0]) = 0x64;
21581 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21582 __Pyx_GOTREF(__pyx_t_4);
21583 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21584 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21585 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21586 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21588 (__pyx_v_f[0]) = 0x67;
21599 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21600 __Pyx_GOTREF(__pyx_t_3);
21601 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21602 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21603 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21604 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21606 (__pyx_v_f[0]) = 90;
21607 (__pyx_v_f[1]) = 0x66;
21608 __pyx_v_f = (__pyx_v_f + 1);
21619 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21620 __Pyx_GOTREF(__pyx_t_4);
21621 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21622 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21623 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21624 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21626 (__pyx_v_f[0]) = 90;
21627 (__pyx_v_f[1]) = 0x64;
21628 __pyx_v_f = (__pyx_v_f + 1);
21639 __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21640 __Pyx_GOTREF(__pyx_t_3);
21641 __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21642 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21643 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21644 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21646 (__pyx_v_f[0]) = 90;
21647 (__pyx_v_f[1]) = 0x67;
21648 __pyx_v_f = (__pyx_v_f + 1);
21659 __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21660 __Pyx_GOTREF(__pyx_t_4);
21661 __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21662 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21663 __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3);
if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21664 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21666 (__pyx_v_f[0]) = 79;
21678 __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21679 __Pyx_GOTREF(__pyx_t_3);
21680 __pyx_t_4 = PyTuple_New(1);
if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21681 __Pyx_GOTREF(__pyx_t_4);
21682 __Pyx_GIVEREF(__pyx_t_3);
21683 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
21685 __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL);
if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21686 __Pyx_GOTREF(__pyx_t_3);
21687 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
21688 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
21689 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
21690 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21701 __pyx_v_f = (__pyx_v_f + 1);
21721 __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset);
if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
21722 __pyx_v_f = __pyx_t_9;
21734 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
21743 __pyx_r = __pyx_v_f;
21756 __Pyx_XDECREF(__pyx_t_1);
21757 __Pyx_XDECREF(__pyx_t_3);
21758 __Pyx_XDECREF(__pyx_t_4);
21759 __Pyx_AddTraceback(
"numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
21762 __Pyx_XDECREF((PyObject *)__pyx_v_child);
21763 __Pyx_XDECREF(__pyx_v_fields);
21764 __Pyx_XDECREF(__pyx_v_childname);
21765 __Pyx_XDECREF(__pyx_v_new_offset);
21766 __Pyx_XDECREF(__pyx_v_t);
21767 __Pyx_RefNannyFinishContext();
21779 static CYTHON_INLINE
void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
21780 PyObject *__pyx_v_baseptr;
21781 __Pyx_RefNannyDeclarations
21784 __Pyx_RefNannySetupContext(
"set_array_base", 0);
21793 __pyx_t_1 = (__pyx_v_base == Py_None);
21794 __pyx_t_2 = (__pyx_t_1 != 0);
21804 __pyx_v_baseptr = NULL;
21824 Py_INCREF(__pyx_v_base);
21833 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
21844 Py_XDECREF(__pyx_v_arr->base);
21853 __pyx_v_arr->base = __pyx_v_baseptr;
21864 __Pyx_RefNannyFinishContext();
21875 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
21876 PyObject *__pyx_r = NULL;
21877 __Pyx_RefNannyDeclarations
21879 __Pyx_RefNannySetupContext(
"get_array_base", 0);
21888 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
21898 __Pyx_XDECREF(__pyx_r);
21899 __Pyx_INCREF(Py_None);
21918 __Pyx_XDECREF(__pyx_r);
21919 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
21920 __pyx_r = ((PyObject *)__pyx_v_arr->base);
21934 __Pyx_XGIVEREF(__pyx_r);
21935 __Pyx_RefNannyFinishContext();
21939 static PyMethodDef __pyx_methods[] = {
21943 #if PY_MAJOR_VERSION >= 3
21944 static struct PyModuleDef __pyx_moduledef = {
21945 #if PY_VERSION_HEX < 0x03020000
21946 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
21948 PyModuleDef_HEAD_INIT,
21950 "subsurfaceTransportFunctions",
21961 static __Pyx_StringTabEntry __pyx_string_tab[] = {
21962 {&__pyx_n_s_DKWr_DpsiC, __pyx_k_DKWr_DpsiC,
sizeof(__pyx_k_DKWr_DpsiC), 0, 0, 1, 1},
21963 {&__pyx_n_s_DsBar_DpsiC, __pyx_k_DsBar_DpsiC,
sizeof(__pyx_k_DsBar_DpsiC), 0, 0, 1, 1},
21964 {&__pyx_n_s_DthetaW_DpsiC, __pyx_k_DthetaW_DpsiC,
sizeof(__pyx_k_DthetaW_DpsiC), 0, 0, 1, 1},
21965 {&__pyx_n_s_DvBar_DpsiC, __pyx_k_DvBar_DpsiC,
sizeof(__pyx_k_DvBar_DpsiC), 0, 0, 1, 1},
21966 {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor,
sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
21967 {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2,
sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
21968 {&__pyx_n_s_I, __pyx_k_I,
sizeof(__pyx_k_I), 0, 0, 1, 1},
21969 {&__pyx_n_s_J, __pyx_k_J,
sizeof(__pyx_k_J), 0, 0, 1, 1},
21970 {&__pyx_n_s_KWr, __pyx_k_KWr,
sizeof(__pyx_k_KWr), 0, 0, 1, 1},
21971 {&__pyx_n_s_KWs, __pyx_k_KWs,
sizeof(__pyx_k_KWs), 0, 0, 1, 1},
21972 {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor,
sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
21973 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_k_RE_NCP1_evaluateElementCoefficie,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie), 0, 0, 1, 1},
21974 {&__pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_k_RE_NCP1_evaluateElementCoefficie_2,
sizeof(__pyx_k_RE_NCP1_evaluateElementCoefficie_2), 0, 0, 1, 1},
21975 {&__pyx_n_s_RE_NCP1_getElementJacobian, __pyx_k_RE_NCP1_getElementJacobian,
sizeof(__pyx_k_RE_NCP1_getElementJacobian), 0, 0, 1, 1},
21976 {&__pyx_n_s_RE_NCP1_getElementResidual, __pyx_k_RE_NCP1_getElementResidual,
sizeof(__pyx_k_RE_NCP1_getElementResidual), 0, 0, 1, 1},
21977 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError,
sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
21978 {&__pyx_n_s_ValueError, __pyx_k_ValueError,
sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
21979 {&__pyx_n_s_a_avg, __pyx_k_a_avg,
sizeof(__pyx_k_a_avg), 0, 0, 1, 1},
21980 {&__pyx_n_s_a_eN, __pyx_k_a_eN,
sizeof(__pyx_k_a_eN), 0, 0, 1, 1},
21981 {&__pyx_n_s_a_neig, __pyx_k_a_neig,
sizeof(__pyx_k_a_neig), 0, 0, 1, 1},
21982 {&__pyx_n_s_a_up, __pyx_k_a_up,
sizeof(__pyx_k_a_up), 0, 0, 1, 1},
21983 {&__pyx_n_s_alpha, __pyx_k_alpha,
sizeof(__pyx_k_alpha), 0, 0, 1, 1},
21984 {&__pyx_n_s_beta, __pyx_k_beta,
sizeof(__pyx_k_beta), 0, 0, 1, 1},
21985 {&__pyx_n_s_calculateNormalFlux, __pyx_k_calculateNormalFlux,
sizeof(__pyx_k_calculateNormalFlux), 0, 0, 1, 1},
21986 {&__pyx_n_s_characteristic_velocity, __pyx_k_characteristic_velocity,
sizeof(__pyx_k_characteristic_velocity), 0, 0, 1, 1},
21987 {&__pyx_n_s_characteristic_velocity_dofs, __pyx_k_characteristic_velocity_dofs,
sizeof(__pyx_k_characteristic_velocity_dofs), 0, 0, 1, 1},
21988 {&__pyx_n_s_clock, __pyx_k_clock,
sizeof(__pyx_k_clock), 0, 0, 1, 1},
21989 {&__pyx_n_s_colind, __pyx_k_colind,
sizeof(__pyx_k_colind), 0, 0, 1, 1},
21990 {&__pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_k_computeSimpleCharacteristicVeloc,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc), 0, 0, 1, 1},
21991 {&__pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_k_computeSimpleCharacteristicVeloc_2,
sizeof(__pyx_k_computeSimpleCharacteristicVeloc_2), 0, 0, 1, 1},
21992 {&__pyx_n_s_d, __pyx_k_d,
sizeof(__pyx_k_d), 0, 0, 1, 1},
21993 {&__pyx_n_s_dS, __pyx_k_dS,
sizeof(__pyx_k_dS), 0, 0, 1, 1},
21994 {&__pyx_n_s_dV, __pyx_k_dV,
sizeof(__pyx_k_dV), 0, 0, 1, 1},
21995 {&__pyx_n_s_denom, __pyx_k_denom,
sizeof(__pyx_k_denom), 0, 0, 1, 1},
21996 {&__pyx_n_s_df, __pyx_k_df,
sizeof(__pyx_k_df), 0, 0, 1, 1},
21997 {&__pyx_n_s_df_dofs, __pyx_k_df_dofs,
sizeof(__pyx_k_df_dofs), 0, 0, 1, 1},
21998 {&__pyx_n_s_dkr_up, __pyx_k_dkr_up,
sizeof(__pyx_k_dkr_up), 0, 0, 1, 1},
21999 {&__pyx_n_s_dm, __pyx_k_dm,
sizeof(__pyx_k_dm), 0, 0, 1, 1},
22000 {&__pyx_n_s_dmt, __pyx_k_dmt,
sizeof(__pyx_k_dmt), 0, 0, 1, 1},
22001 {&__pyx_n_s_dmtj_avg, __pyx_k_dmtj_avg,
sizeof(__pyx_k_dmtj_avg), 0, 0, 1, 1},
22002 {&__pyx_n_s_dot, __pyx_k_dot,
sizeof(__pyx_k_dot), 0, 0, 1, 1},
22003 {&__pyx_n_s_drhom, __pyx_k_drhom,
sizeof(__pyx_k_drhom), 0, 0, 1, 1},
22004 {&__pyx_n_s_eN, __pyx_k_eN,
sizeof(__pyx_k_eN), 0, 0, 1, 1},
22005 {&__pyx_n_s_eN_left, __pyx_k_eN_left,
sizeof(__pyx_k_eN_left), 0, 0, 1, 1},
22006 {&__pyx_n_s_eN_neighbor, __pyx_k_eN_neighbor,
sizeof(__pyx_k_eN_neighbor), 0, 0, 1, 1},
22007 {&__pyx_n_s_eN_right, __pyx_k_eN_right,
sizeof(__pyx_k_eN_right), 0, 0, 1, 1},
22008 {&__pyx_n_s_ebN, __pyx_k_ebN,
sizeof(__pyx_k_ebN), 0, 0, 1, 1},
22009 {&__pyx_n_s_ebNE, __pyx_k_ebNE,
sizeof(__pyx_k_ebNE), 0, 0, 1, 1},
22010 {&__pyx_n_s_ebN_local, __pyx_k_ebN_local,
sizeof(__pyx_k_ebN_local), 0, 0, 1, 1},
22011 {&__pyx_n_s_ebq_global_vals, __pyx_k_ebq_global_vals,
sizeof(__pyx_k_ebq_global_vals), 0, 0, 1, 1},
22012 {&__pyx_n_s_ebq_vals, __pyx_k_ebq_vals,
sizeof(__pyx_k_ebq_vals), 0, 0, 1, 1},
22013 {&__pyx_n_s_elementBarycentersArray, __pyx_k_elementBarycentersArray,
sizeof(__pyx_k_elementBarycentersArray), 0, 0, 1, 1},
22014 {&__pyx_n_s_elementBoundariesArray, __pyx_k_elementBoundariesArray,
sizeof(__pyx_k_elementBoundariesArray), 0, 0, 1, 1},
22015 {&__pyx_n_s_elementBoundaryElementsArray, __pyx_k_elementBoundaryElementsArray,
sizeof(__pyx_k_elementBoundaryElementsArray), 0, 0, 1, 1},
22016 {&__pyx_n_s_elementBoundaryMaterialTypes, __pyx_k_elementBoundaryMaterialTypes,
sizeof(__pyx_k_elementBoundaryMaterialTypes), 0, 0, 1, 1},
22017 {&__pyx_n_s_elementBoundaryTypes, __pyx_k_elementBoundaryTypes,
sizeof(__pyx_k_elementBoundaryTypes), 0, 0, 1, 1},
22018 {&__pyx_n_s_elementJacobian, __pyx_k_elementJacobian,
sizeof(__pyx_k_elementJacobian), 0, 0, 1, 1},
22019 {&__pyx_n_s_elementMaterialTypes, __pyx_k_elementMaterialTypes,
sizeof(__pyx_k_elementMaterialTypes), 0, 0, 1, 1},
22020 {&__pyx_n_s_elementNeighborsArray, __pyx_k_elementNeighborsArray,
sizeof(__pyx_k_elementNeighborsArray), 0, 0, 1, 1},
22021 {&__pyx_n_s_elementResidual, __pyx_k_elementResidual,
sizeof(__pyx_k_elementResidual), 0, 0, 1, 1},
22022 {&__pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_k_evaluateScalarMaterialFunctionOv,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv), 0, 0, 1, 1},
22023 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_k_evaluateScalarMaterialFunctionOv_2,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_2), 0, 0, 1, 1},
22024 {&__pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_k_evaluateScalarMaterialFunctionOv_3,
sizeof(__pyx_k_evaluateScalarMaterialFunctionOv_3), 0, 0, 1, 1},
22025 {&__pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_k_evaluateSparseTensorMaterialFunc,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc), 0, 0, 1, 1},
22026 {&__pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_k_evaluateSparseTensorMaterialFunc_2,
sizeof(__pyx_k_evaluateSparseTensorMaterialFunc_2), 0, 0, 1, 1},
22027 {&__pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_k_evaluateVectorMaterialFunctionOv,
sizeof(__pyx_k_evaluateVectorMaterialFunctionOv), 0, 0, 1, 1},
22028 {&__pyx_n_s_exteriorElementBoundariesArray, __pyx_k_exteriorElementBoundariesArray,
sizeof(__pyx_k_exteriorElementBoundariesArray), 0, 0, 1, 1},
22029 {&__pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_k_exteriorElementBoundaryMaterialT,
sizeof(__pyx_k_exteriorElementBoundaryMaterialT), 0, 0, 1, 1},
22030 {&__pyx_n_s_f_up, __pyx_k_f_up,
sizeof(__pyx_k_f_up), 0, 0, 1, 1},
22031 {&__pyx_n_s_flat, __pyx_k_flat,
sizeof(__pyx_k_flat), 0, 0, 1, 1},
22032 {&__pyx_n_s_flux, __pyx_k_flux,
sizeof(__pyx_k_flux), 0, 0, 1, 1},
22033 {&__pyx_n_s_gravity, __pyx_k_gravity,
sizeof(__pyx_k_gravity), 0, 0, 1, 1},
22034 {&__pyx_n_s_helicalElementVelocityEval3, __pyx_k_helicalElementVelocityEval3,
sizeof(__pyx_k_helicalElementVelocityEval3), 0, 0, 1, 1},
22035 {&__pyx_n_s_helicalElementVelocityEval4, __pyx_k_helicalElementVelocityEval4,
sizeof(__pyx_k_helicalElementVelocityEval4), 0, 0, 1, 1},
22036 {&__pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_k_home_cekees_proteus_proteus_sub,
sizeof(__pyx_k_home_cekees_proteus_proteus_sub), 0, 0, 1, 0},
22037 {&__pyx_n_s_i, __pyx_k_i,
sizeof(__pyx_k_i), 0, 0, 1, 1},
22038 {&__pyx_n_s_ii, __pyx_k_ii,
sizeof(__pyx_k_ii), 0, 0, 1, 1},
22039 {&__pyx_n_s_import, __pyx_k_import,
sizeof(__pyx_k_import), 0, 0, 1, 1},
22040 {&__pyx_n_s_integral, __pyx_k_integral,
sizeof(__pyx_k_integral), 0, 0, 1, 1},
22041 {&__pyx_n_s_j, __pyx_k_j,
sizeof(__pyx_k_j), 0, 0, 1, 1},
22042 {&__pyx_n_s_jacobian_weak_residual, __pyx_k_jacobian_weak_residual,
sizeof(__pyx_k_jacobian_weak_residual), 0, 0, 1, 1},
22043 {&__pyx_n_s_k, __pyx_k_k,
sizeof(__pyx_k_k), 0, 0, 1, 1},
22044 {&__pyx_n_s_kb, __pyx_k_kb,
sizeof(__pyx_k_kb), 0, 0, 1, 1},
22045 {&__pyx_n_s_kr_eN, __pyx_k_kr_eN,
sizeof(__pyx_k_kr_eN), 0, 0, 1, 1},
22046 {&__pyx_n_s_kr_neig, __pyx_k_kr_neig,
sizeof(__pyx_k_kr_neig), 0, 0, 1, 1},
22047 {&__pyx_n_s_l2g, __pyx_k_l2g,
sizeof(__pyx_k_l2g), 0, 0, 1, 1},
22048 {&__pyx_n_s_m, __pyx_k_m,
sizeof(__pyx_k_m), 0, 0, 1, 1},
22049 {&__pyx_n_s_main, __pyx_k_main,
sizeof(__pyx_k_main), 0, 0, 1, 1},
22050 {&__pyx_n_s_matID, __pyx_k_matID,
sizeof(__pyx_k_matID), 0, 0, 1, 1},
22051 {&__pyx_n_s_matID_neig, __pyx_k_matID_neig,
sizeof(__pyx_k_matID_neig), 0, 0, 1, 1},
22052 {&__pyx_n_s_material, __pyx_k_material,
sizeof(__pyx_k_material), 0, 0, 1, 1},
22053 {&__pyx_n_s_material_functions, __pyx_k_material_functions,
sizeof(__pyx_k_material_functions), 0, 0, 1, 1},
22054 {&__pyx_n_s_material_left, __pyx_k_material_left,
sizeof(__pyx_k_material_left), 0, 0, 1, 1},
22055 {&__pyx_n_s_material_right, __pyx_k_material_right,
sizeof(__pyx_k_material_right), 0, 0, 1, 1},
22056 {&__pyx_n_s_mt, __pyx_k_mt,
sizeof(__pyx_k_mt), 0, 0, 1, 1},
22057 {&__pyx_n_s_mt_avg, __pyx_k_mt_avg,
sizeof(__pyx_k_mt_avg), 0, 0, 1, 1},
22058 {&__pyx_n_s_n, __pyx_k_n,
sizeof(__pyx_k_n), 0, 0, 1, 1},
22059 {&__pyx_n_s_nAvgWeight, __pyx_k_nAvgWeight,
sizeof(__pyx_k_nAvgWeight), 0, 0, 1, 1},
22060 {&__pyx_n_s_nDOF_test_element, __pyx_k_nDOF_test_element,
sizeof(__pyx_k_nDOF_test_element), 0, 0, 1, 1},
22061 {&__pyx_n_s_nDOF_trial_element, __pyx_k_nDOF_trial_element,
sizeof(__pyx_k_nDOF_trial_element), 0, 0, 1, 1},
22062 {&__pyx_n_s_nElementBoundaries_element, __pyx_k_nElementBoundaries_element,
sizeof(__pyx_k_nElementBoundaries_element), 0, 0, 1, 1},
22063 {&__pyx_n_s_nElementBoundaries_global, __pyx_k_nElementBoundaries_global,
sizeof(__pyx_k_nElementBoundaries_global), 0, 0, 1, 1},
22064 {&__pyx_n_s_nElements_global, __pyx_k_nElements_global,
sizeof(__pyx_k_nElements_global), 0, 0, 1, 1},
22065 {&__pyx_n_s_nExteriorElementBoundaries_globa, __pyx_k_nExteriorElementBoundaries_globa,
sizeof(__pyx_k_nExteriorElementBoundaries_globa), 0, 0, 1, 1},
22066 {&__pyx_n_s_nSpace, __pyx_k_nSpace,
sizeof(__pyx_k_nSpace), 0, 0, 1, 1},
22067 {&__pyx_n_s_nSpace2, __pyx_k_nSpace2,
sizeof(__pyx_k_nSpace2), 0, 0, 1, 1},
22068 {&__pyx_n_s_nd, __pyx_k_nd,
sizeof(__pyx_k_nd), 0, 0, 1, 1},
22069 {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous,
sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22070 {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou,
sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22071 {&__pyx_n_s_nnz, __pyx_k_nnz,
sizeof(__pyx_k_nnz), 0, 0, 1, 1},
22072 {&__pyx_n_s_numer, __pyx_k_numer,
sizeof(__pyx_k_numer), 0, 0, 1, 1},
22073 {&__pyx_n_s_numpy, __pyx_k_numpy,
sizeof(__pyx_k_numpy), 0, 0, 1, 1},
22074 {&__pyx_n_s_omega_e, __pyx_k_omega_e,
sizeof(__pyx_k_omega_e), 0, 0, 1, 1},
22075 {&__pyx_n_s_one8, __pyx_k_one8,
sizeof(__pyx_k_one8), 0, 0, 1, 1},
22076 {&__pyx_n_s_onePlus_pcBar_n, __pyx_k_onePlus_pcBar_n,
sizeof(__pyx_k_onePlus_pcBar_n), 0, 0, 1, 1},
22077 {&__pyx_n_s_pcBar, __pyx_k_pcBar,
sizeof(__pyx_k_pcBar), 0, 0, 1, 1},
22078 {&__pyx_n_s_pcBar_n, __pyx_k_pcBar_n,
sizeof(__pyx_k_pcBar_n), 0, 0, 1, 1},
22079 {&__pyx_n_s_pcBar_nM1, __pyx_k_pcBar_nM1,
sizeof(__pyx_k_pcBar_nM1), 0, 0, 1, 1},
22080 {&__pyx_n_s_pcBar_nM2, __pyx_k_pcBar_nM2,
sizeof(__pyx_k_pcBar_nM2), 0, 0, 1, 1},
22081 {&__pyx_n_s_phi_eN, __pyx_k_phi_eN,
sizeof(__pyx_k_phi_eN), 0, 0, 1, 1},
22082 {&__pyx_n_s_phi_neig, __pyx_k_phi_neig,
sizeof(__pyx_k_phi_neig), 0, 0, 1, 1},
22083 {&__pyx_n_s_pi, __pyx_k_pi,
sizeof(__pyx_k_pi), 0, 0, 1, 1},
22084 {&__pyx_n_s_picard, __pyx_k_picard,
sizeof(__pyx_k_picard), 0, 0, 1, 1},
22085 {&__pyx_n_s_psiC, __pyx_k_psiC,
sizeof(__pyx_k_psiC), 0, 0, 1, 1},
22086 {&__pyx_n_s_q, __pyx_k_q,
sizeof(__pyx_k_q), 0, 0, 1, 1},
22087 {&__pyx_n_s_q_alin, __pyx_k_q_alin,
sizeof(__pyx_k_q_alin), 0, 0, 1, 1},
22088 {&__pyx_n_s_q_detJ, __pyx_k_q_detJ,
sizeof(__pyx_k_q_detJ), 0, 0, 1, 1},
22089 {&__pyx_n_s_q_dkr, __pyx_k_q_dkr,
sizeof(__pyx_k_q_dkr), 0, 0, 1, 1},
22090 {&__pyx_n_s_q_dm, __pyx_k_q_dm,
sizeof(__pyx_k_q_dm), 0, 0, 1, 1},
22091 {&__pyx_n_s_q_dmass, __pyx_k_q_dmass,
sizeof(__pyx_k_q_dmass), 0, 0, 1, 1},
22092 {&__pyx_n_s_q_dmt, __pyx_k_q_dmt,
sizeof(__pyx_k_q_dmt), 0, 0, 1, 1},
22093 {&__pyx_n_s_q_flin, __pyx_k_q_flin,
sizeof(__pyx_k_q_flin), 0, 0, 1, 1},
22094 {&__pyx_n_s_q_grad_u, __pyx_k_q_grad_u,
sizeof(__pyx_k_q_grad_u), 0, 0, 1, 1},
22095 {&__pyx_n_s_q_grad_v, __pyx_k_q_grad_v,
sizeof(__pyx_k_q_grad_v), 0, 0, 1, 1},
22096 {&__pyx_n_s_q_grad_w, __pyx_k_q_grad_w,
sizeof(__pyx_k_q_grad_w), 0, 0, 1, 1},
22097 {&__pyx_n_s_q_kr, __pyx_k_q_kr,
sizeof(__pyx_k_q_kr), 0, 0, 1, 1},
22098 {&__pyx_n_s_q_kr_up, __pyx_k_q_kr_up,
sizeof(__pyx_k_q_kr_up), 0, 0, 1, 1},
22099 {&__pyx_n_s_q_m, __pyx_k_q_m,
sizeof(__pyx_k_q_m), 0, 0, 1, 1},
22100 {&__pyx_n_s_q_mass, __pyx_k_q_mass,
sizeof(__pyx_k_q_mass), 0, 0, 1, 1},
22101 {&__pyx_n_s_q_mt, __pyx_k_q_mt,
sizeof(__pyx_k_q_mt), 0, 0, 1, 1},
22102 {&__pyx_n_s_q_r, __pyx_k_q_r,
sizeof(__pyx_k_q_r), 0, 0, 1, 1},
22103 {&__pyx_n_s_q_u, __pyx_k_q_u,
sizeof(__pyx_k_q_u), 0, 0, 1, 1},
22104 {&__pyx_n_s_q_vals, __pyx_k_q_vals,
sizeof(__pyx_k_q_vals), 0, 0, 1, 1},
22105 {&__pyx_n_s_q_x, __pyx_k_q_x,
sizeof(__pyx_k_q_x), 0, 0, 1, 1},
22106 {&__pyx_n_s_range, __pyx_k_range,
sizeof(__pyx_k_range), 0, 0, 1, 1},
22107 {&__pyx_n_s_rho, __pyx_k_rho,
sizeof(__pyx_k_rho), 0, 0, 1, 1},
22108 {&__pyx_n_s_rho2, __pyx_k_rho2,
sizeof(__pyx_k_rho2), 0, 0, 1, 1},
22109 {&__pyx_n_s_rhom, __pyx_k_rhom,
sizeof(__pyx_k_rhom), 0, 0, 1, 1},
22110 {&__pyx_n_s_rotatingGaussianElementVelocityE, __pyx_k_rotatingGaussianElementVelocityE,
sizeof(__pyx_k_rotatingGaussianElementVelocityE), 0, 0, 1, 1},
22111 {&__pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_k_rotatingGaussianElementVelocityE_2,
sizeof(__pyx_k_rotatingGaussianElementVelocityE_2), 0, 0, 1, 1},
22112 {&__pyx_n_s_rowptr, __pyx_k_rowptr,
sizeof(__pyx_k_rowptr), 0, 0, 1, 1},
22113 {&__pyx_n_s_sBar, __pyx_k_sBar,
sizeof(__pyx_k_sBar), 0, 0, 1, 1},
22114 {&__pyx_n_s_setElementBoundariesArray, __pyx_k_setElementBoundariesArray,
sizeof(__pyx_k_setElementBoundariesArray), 0, 0, 1, 1},
22115 {&__pyx_n_s_setExteriorElementBoundaryTypes, __pyx_k_setExteriorElementBoundaryTypes,
sizeof(__pyx_k_setExteriorElementBoundaryTypes), 0, 0, 1, 1},
22116 {&__pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_k_setScalarMaterialFunctionOverEle,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle), 0, 0, 1, 1},
22117 {&__pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_k_setScalarMaterialFunctionOverEle_2,
sizeof(__pyx_k_setScalarMaterialFunctionOverEle_2), 0, 0, 1, 1},
22118 {&__pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_k_setScalarMaterialFunctionOverGlo,
sizeof(__pyx_k_setScalarMaterialFunctionOverGlo), 0, 0, 1, 1},
22119 {&__pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_k_setSparseTensorMaterialFunctionO,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO), 0, 0, 1, 1},
22120 {&__pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_k_setSparseTensorMaterialFunctionO_2,
sizeof(__pyx_k_setSparseTensorMaterialFunctionO_2), 0, 0, 1, 1},
22121 {&__pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_k_setVectorMaterialFunctionOverEle,
sizeof(__pyx_k_setVectorMaterialFunctionOverEle), 0, 0, 1, 1},
22122 {&__pyx_n_s_shape, __pyx_k_shape,
sizeof(__pyx_k_shape), 0, 0, 1, 1},
22123 {&__pyx_n_s_sqrt_sBar, __pyx_k_sqrt_sBar,
sizeof(__pyx_k_sqrt_sBar), 0, 0, 1, 1},
22124 {&__pyx_n_s_subsurfaceTransportFunctions, __pyx_k_subsurfaceTransportFunctions,
sizeof(__pyx_k_subsurfaceTransportFunctions), 0, 0, 1, 1},
22125 {&__pyx_n_s_sum, __pyx_k_sum,
sizeof(__pyx_k_sum), 0, 0, 1, 1},
22126 {&__pyx_n_s_t, __pyx_k_t,
sizeof(__pyx_k_t), 0, 0, 1, 1},
22127 {&__pyx_n_s_tForReversal, __pyx_k_tForReversal,
sizeof(__pyx_k_tForReversal), 0, 0, 1, 1},
22128 {&__pyx_n_s_test, __pyx_k_test,
sizeof(__pyx_k_test), 0, 0, 1, 1},
22129 {&__pyx_n_s_thetaR, __pyx_k_thetaR,
sizeof(__pyx_k_thetaR), 0, 0, 1, 1},
22130 {&__pyx_n_s_thetaS, __pyx_k_thetaS,
sizeof(__pyx_k_thetaS), 0, 0, 1, 1},
22131 {&__pyx_n_s_thetaSR, __pyx_k_thetaSR,
sizeof(__pyx_k_thetaSR), 0, 0, 1, 1},
22132 {&__pyx_n_s_thetaW, __pyx_k_thetaW,
sizeof(__pyx_k_thetaW), 0, 0, 1, 1},
22133 {&__pyx_n_s_thisElementIsUpwind, __pyx_k_thisElementIsUpwind,
sizeof(__pyx_k_thisElementIsUpwind), 0, 0, 1, 1},
22134 {&__pyx_n_s_transient, __pyx_k_transient,
sizeof(__pyx_k_transient), 0, 0, 1, 1},
22135 {&__pyx_n_s_u_dof, __pyx_k_u_dof,
sizeof(__pyx_k_u_dof), 0, 0, 1, 1},
22136 {&__pyx_n_s_u_eN, __pyx_k_u_eN,
sizeof(__pyx_k_u_eN), 0, 0, 1, 1},
22137 {&__pyx_n_s_u_j, __pyx_k_u_j,
sizeof(__pyx_k_u_j), 0, 0, 1, 1},
22138 {&__pyx_n_s_u_l2g, __pyx_k_u_l2g,
sizeof(__pyx_k_u_l2g), 0, 0, 1, 1},
22139 {&__pyx_n_s_u_neig, __pyx_k_u_neig,
sizeof(__pyx_k_u_neig), 0, 0, 1, 1},
22140 {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd,
sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22141 {&__pyx_n_s_updateMassJacobian_weakAvg, __pyx_k_updateMassJacobian_weakAvg,
sizeof(__pyx_k_updateMassJacobian_weakAvg), 0, 0, 1, 1},
22142 {&__pyx_n_s_updateMass_weakAvg, __pyx_k_updateMass_weakAvg,
sizeof(__pyx_k_updateMass_weakAvg), 0, 0, 1, 1},
22143 {&__pyx_n_s_upwindFlag, __pyx_k_upwindFlag,
sizeof(__pyx_k_upwindFlag), 0, 0, 1, 1},
22144 {&__pyx_n_s_v, __pyx_k_v,
sizeof(__pyx_k_v), 0, 0, 1, 1},
22145 {&__pyx_n_s_vBar, __pyx_k_vBar,
sizeof(__pyx_k_vBar), 0, 0, 1, 1},
22146 {&__pyx_n_s_vBar2, __pyx_k_vBar2,
sizeof(__pyx_k_vBar2), 0, 0, 1, 1},
22147 {&__pyx_n_s_vol, __pyx_k_vol,
sizeof(__pyx_k_vol), 0, 0, 1, 1},
22148 {&__pyx_n_s_volFactor, __pyx_k_volFactor,
sizeof(__pyx_k_volFactor), 0, 0, 1, 1},
22149 {&__pyx_n_s_vol_e, __pyx_k_vol_e,
sizeof(__pyx_k_vol_e), 0, 0, 1, 1},
22150 {&__pyx_n_s_volume, __pyx_k_volume,
sizeof(__pyx_k_volume), 0, 0, 1, 1},
22151 {&__pyx_n_s_vortexElementVelocityEval3, __pyx_k_vortexElementVelocityEval3,
sizeof(__pyx_k_vortexElementVelocityEval3), 0, 0, 1, 1},
22152 {&__pyx_n_s_vortexElementVelocityEval4, __pyx_k_vortexElementVelocityEval4,
sizeof(__pyx_k_vortexElementVelocityEval4), 0, 0, 1, 1},
22153 {&__pyx_n_s_w, __pyx_k_w,
sizeof(__pyx_k_w), 0, 0, 1, 1},
22154 {&__pyx_n_s_weak_residual, __pyx_k_weak_residual,
sizeof(__pyx_k_weak_residual), 0, 0, 1, 1},
22155 {&__pyx_n_s_weight, __pyx_k_weight,
sizeof(__pyx_k_weight), 0, 0, 1, 1},
22156 {&__pyx_n_s_x, __pyx_k_x,
sizeof(__pyx_k_x), 0, 0, 1, 1},
22157 {&__pyx_n_s_xc, __pyx_k_xc,
sizeof(__pyx_k_xc), 0, 0, 1, 1},
22158 {&__pyx_n_s_yc, __pyx_k_yc,
sizeof(__pyx_k_yc), 0, 0, 1, 1},
22159 {&__pyx_n_s_zVelocity, __pyx_k_zVelocity,
sizeof(__pyx_k_zVelocity), 0, 0, 1, 1},
22160 {&__pyx_n_s_zeros, __pyx_k_zeros,
sizeof(__pyx_k_zeros), 0, 0, 1, 1},
22161 {&__pyx_n_s_zvelocity, __pyx_k_zvelocity,
sizeof(__pyx_k_zvelocity), 0, 0, 1, 1},
22162 {0, 0, 0, 0, 0, 0, 0}
22164 static int __Pyx_InitCachedBuiltins(
void) {
22165 __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range);
if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 24; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22166 __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError);
if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22167 __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError);
if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22173 static int __Pyx_InitCachedConstants(
void) {
22174 __Pyx_RefNannyDeclarations
22175 __Pyx_RefNannySetupContext(
"__Pyx_InitCachedConstants", 0);
22184 __pyx_slice_ = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22185 __Pyx_GOTREF(__pyx_slice_);
22186 __Pyx_GIVEREF(__pyx_slice_);
22195 __pyx_slice__2 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22196 __Pyx_GOTREF(__pyx_slice__2);
22197 __Pyx_GIVEREF(__pyx_slice__2);
22206 __pyx_slice__3 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 794; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22207 __Pyx_GOTREF(__pyx_slice__3);
22208 __Pyx_GIVEREF(__pyx_slice__3);
22217 __pyx_slice__4 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 808; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22218 __Pyx_GOTREF(__pyx_slice__4);
22219 __Pyx_GIVEREF(__pyx_slice__4);
22228 __pyx_slice__5 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 835; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22229 __Pyx_GOTREF(__pyx_slice__5);
22230 __Pyx_GIVEREF(__pyx_slice__5);
22239 __pyx_slice__6 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 851; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22240 __Pyx_GOTREF(__pyx_slice__6);
22241 __Pyx_GIVEREF(__pyx_slice__6);
22250 __pyx_slice__7 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 876; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22251 __Pyx_GOTREF(__pyx_slice__7);
22252 __Pyx_GIVEREF(__pyx_slice__7);
22261 __pyx_slice__8 = PySlice_New(Py_None, Py_None, Py_None);
if (unlikely(!__pyx_slice__8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 902; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22262 __Pyx_GOTREF(__pyx_slice__8);
22263 __Pyx_GIVEREF(__pyx_slice__8);
22272 __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous);
if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 218; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22273 __Pyx_GOTREF(__pyx_tuple__9);
22274 __Pyx_GIVEREF(__pyx_tuple__9);
22283 __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou);
if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 222; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22284 __Pyx_GOTREF(__pyx_tuple__10);
22285 __Pyx_GIVEREF(__pyx_tuple__10);
22294 __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 259; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22295 __Pyx_GOTREF(__pyx_tuple__11);
22296 __Pyx_GIVEREF(__pyx_tuple__11);
22305 __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor);
if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22306 __Pyx_GOTREF(__pyx_tuple__12);
22307 __Pyx_GIVEREF(__pyx_tuple__12);
22316 __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor);
if (unlikely(!__pyx_tuple__13)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22317 __Pyx_GOTREF(__pyx_tuple__13);
22318 __Pyx_GIVEREF(__pyx_tuple__13);
22327 __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2);
if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22328 __Pyx_GOTREF(__pyx_tuple__14);
22329 __Pyx_GIVEREF(__pyx_tuple__14);
22338 __pyx_tuple__15 = PyTuple_Pack(8, __pyx_n_s_nExteriorElementBoundaries_globa, __pyx_n_s_exteriorElementBoundariesArray, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_exteriorElementBoundaryMaterialT, __pyx_n_s_ebNE, __pyx_n_s_ebN, __pyx_n_s_eN);
if (unlikely(!__pyx_tuple__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22339 __Pyx_GOTREF(__pyx_tuple__15);
22340 __Pyx_GIVEREF(__pyx_tuple__15);
22341 __pyx_codeobj__16 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__15, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setExteriorElementBoundaryTypes, 18, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22350 __pyx_tuple__17 = PyTuple_Pack(7, __pyx_n_s_nElementBoundaries_global, __pyx_n_s_elementBoundaryElementsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_elementBoundaryMaterialTypes, __pyx_n_s_ebN, __pyx_n_s_eN_left, __pyx_n_s_eN_right);
if (unlikely(!__pyx_tuple__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22351 __Pyx_GOTREF(__pyx_tuple__17);
22352 __Pyx_GIVEREF(__pyx_tuple__17);
22353 __pyx_codeobj__18 = (PyObject*)__Pyx_PyCode_New(4, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__17, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setElementBoundariesArray, 29, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22362 __pyx_tuple__19 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__19)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22363 __Pyx_GOTREF(__pyx_tuple__19);
22364 __Pyx_GIVEREF(__pyx_tuple__19);
22365 __pyx_codeobj__20 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__19, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverEle, 43, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22374 __pyx_tuple__21 = PyTuple_Pack(6, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22375 __Pyx_GOTREF(__pyx_tuple__21);
22376 __Pyx_GIVEREF(__pyx_tuple__21);
22377 __pyx_codeobj__22 = (PyObject*)__Pyx_PyCode_New(3, 0, 6, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__21, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setVectorMaterialFunctionOverEle, 56, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__22)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22386 __pyx_tuple__23 = PyTuple_Pack(10, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__23)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22387 __Pyx_GOTREF(__pyx_tuple__23);
22388 __Pyx_GIVEREF(__pyx_tuple__23);
22389 __pyx_codeobj__24 = (PyObject*)__Pyx_PyCode_New(4, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__23, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverEle_2, 69, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22398 __pyx_tuple__25 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22399 __Pyx_GOTREF(__pyx_tuple__25);
22400 __Pyx_GIVEREF(__pyx_tuple__25);
22401 __pyx_codeobj__26 = (PyObject*)__Pyx_PyCode_New(5, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__25, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setSparseTensorMaterialFunctionO, 91, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22410 __pyx_tuple__27 = PyTuple_Pack(8, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__27)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22411 __Pyx_GOTREF(__pyx_tuple__27);
22412 __Pyx_GIVEREF(__pyx_tuple__27);
22413 __pyx_codeobj__28 = (PyObject*)__Pyx_PyCode_New(4, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__27, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setScalarMaterialFunctionOverGlo, 118, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__28)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22422 __pyx_tuple__29 = PyTuple_Pack(13, __pyx_n_s_nd, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__29)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22423 __Pyx_GOTREF(__pyx_tuple__29);
22424 __Pyx_GIVEREF(__pyx_tuple__29);
22425 __pyx_codeobj__30 = (PyObject*)__Pyx_PyCode_New(5, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__29, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_setSparseTensorMaterialFunctionO_2, 139, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__30)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22434 __pyx_tuple__31 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__31)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22435 __Pyx_GOTREF(__pyx_tuple__31);
22436 __Pyx_GIVEREF(__pyx_tuple__31);
22437 __pyx_codeobj__32 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__31, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv, 165, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__32)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22446 __pyx_tuple__33 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_elementMaterialTypes, __pyx_n_s_x, __pyx_n_s_q_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_material);
if (unlikely(!__pyx_tuple__33)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22447 __Pyx_GOTREF(__pyx_tuple__33);
22448 __Pyx_GIVEREF(__pyx_tuple__33);
22449 __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(5, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateVectorMaterialFunctionOv, 180, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__34)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22458 __pyx_tuple__35 = PyTuple_Pack(12, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right);
if (unlikely(!__pyx_tuple__35)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22459 __Pyx_GOTREF(__pyx_tuple__35);
22460 __Pyx_GIVEREF(__pyx_tuple__35);
22461 __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(6, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, 195, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22470 __pyx_tuple__37 = PyTuple_Pack(17, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_vals, __pyx_n_s_material_functions, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_ebN_local, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22471 __Pyx_GOTREF(__pyx_tuple__37);
22472 __Pyx_GIVEREF(__pyx_tuple__37);
22473 __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(7, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateSparseTensorMaterialFunc, 219, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__38)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22482 __pyx_tuple__39 = PyTuple_Pack(10, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_k);
if (unlikely(!__pyx_tuple__39)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22483 __Pyx_GOTREF(__pyx_tuple__39);
22484 __Pyx_GIVEREF(__pyx_tuple__39);
22485 __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(6, 0, 10, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, 248, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__40)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22494 __pyx_tuple__41 = PyTuple_Pack(15, __pyx_n_s_nd, __pyx_n_s_t, __pyx_n_s_elementBoundariesArray, __pyx_n_s_elementBoundaryTypes, __pyx_n_s_x, __pyx_n_s_ebq_global_vals, __pyx_n_s_material_functions, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_material_left, __pyx_n_s_material_right, __pyx_n_s_I, __pyx_n_s_J, __pyx_n_s_numer, __pyx_n_s_denom);
if (unlikely(!__pyx_tuple__41)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22495 __Pyx_GOTREF(__pyx_tuple__41);
22496 __Pyx_GIVEREF(__pyx_tuple__41);
22497 __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(7, 0, 15, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, 271, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__42)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22506 __pyx_tuple__43 = PyTuple_Pack(24, __pyx_n_s_rho, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_KWs, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_ebN, __pyx_n_s_matID, __pyx_n_s_matID_neig, __pyx_n_s_nSpace2, __pyx_n_s_nnz, __pyx_n_s_a_eN, __pyx_n_s_a_neig, __pyx_n_s_a_avg);
if (unlikely(!__pyx_tuple__43)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22507 __Pyx_GOTREF(__pyx_tuple__43);
22508 __Pyx_GIVEREF(__pyx_tuple__43);
22509 __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(12, 0, 24, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, 301, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__44)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22518 __pyx_tuple__45 = PyTuple_Pack(61, __pyx_n_s_rho, __pyx_n_s_beta, __pyx_n_s_gravity, __pyx_n_s_alpha, __pyx_n_s_n, __pyx_n_s_thetaR, __pyx_n_s_thetaSR, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_elementMaterialTypes, __pyx_n_s_nDOF_trial_element, __pyx_n_s_u_l2g, __pyx_n_s_u_dof, __pyx_n_s_q_x, __pyx_n_s_q_u, __pyx_n_s_q_mass, __pyx_n_s_q_dmass, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q, __pyx_n_s_psiC, __pyx_n_s_pcBar, __pyx_n_s_pcBar_n, __pyx_n_s_pcBar_nM1, __pyx_n_s_pcBar_nM2, __pyx_n_s_onePlus_pcBar_n, __pyx_n_s_sBar, __pyx_n_s_sqrt_sBar, __pyx_n_s_DsBar_DpsiC, __pyx_n_s_thetaW, __pyx_n_s_DthetaW_DpsiC, __pyx_n_s_vBar, __pyx_n_s_vBar2, __pyx_n_s_DvBar_DpsiC, __pyx_n_s_KWr, __pyx_n_s_DKWr_DpsiC, __pyx_n_s_rho2, __pyx_n_s_thetaS, __pyx_n_s_rhom, __pyx_n_s_drhom, __pyx_n_s_m, __pyx_n_s_u_j, __pyx_n_s_u_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_eN, __pyx_n_s_kr_neig, __pyx_n_s_phi_eN, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ebN, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_j, __pyx_n_s_matID, __pyx_n_s_nAvgWeight);
if (unlikely(!__pyx_tuple__45)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22519 __Pyx_GOTREF(__pyx_tuple__45);
22520 __Pyx_GIVEREF(__pyx_tuple__45);
22521 __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(24, 0, 61, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, 359, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__46)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22530 __pyx_tuple__47 = PyTuple_Pack(42, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_mt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementResidual, __pyx_n_s_upwindFlag, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_volume);
if (unlikely(!__pyx_tuple__47)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22531 __Pyx_GOTREF(__pyx_tuple__47);
22532 __Pyx_GIVEREF(__pyx_tuple__47);
22533 __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(21, 0, 42, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_getElementResidual, 486, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__48)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22542 __pyx_tuple__49 = PyTuple_Pack(51, __pyx_n_s_gravity, __pyx_n_s_rowptr, __pyx_n_s_colind, __pyx_n_s_nSpace, __pyx_n_s_nElements_global, __pyx_n_s_nElementBoundaries_element, __pyx_n_s_elementNeighborsArray, __pyx_n_s_elementBarycentersArray, __pyx_n_s_nDOF_test_element, __pyx_n_s_nDOF_trial_element, __pyx_n_s_q_u, __pyx_n_s_q_grad_u, __pyx_n_s_q_grad_w, __pyx_n_s_q_grad_v, __pyx_n_s_q_detJ, __pyx_n_s_q_m, __pyx_n_s_q_dm, __pyx_n_s_q_mt, __pyx_n_s_q_dmt, __pyx_n_s_q_r, __pyx_n_s_q_kr, __pyx_n_s_q_dkr, __pyx_n_s_q_kr_up, __pyx_n_s_q_flin, __pyx_n_s_q_alin, __pyx_n_s_elementJacobian, __pyx_n_s_upwindFlag, __pyx_n_s_picard, __pyx_n_s_q, __pyx_n_s_nnz, __pyx_n_s_u_eN, __pyx_n_s_kr_eN, __pyx_n_s_phi_eN, __pyx_n_s_u_neig, __pyx_n_s_kr_neig, __pyx_n_s_phi_neig, __pyx_n_s_dkr_up, __pyx_n_s_eN, __pyx_n_s_eN_neighbor, __pyx_n_s_ii, __pyx_n_s_I, __pyx_n_s_a_up, __pyx_n_s_f_up, __pyx_n_s_nAvgWeight, __pyx_n_s_weight, __pyx_n_s_volFactor, __pyx_n_s_thisElementIsUpwind, __pyx_n_s_volume, __pyx_n_s_i, __pyx_n_s_ebN, __pyx_n_s_j);
if (unlikely(!__pyx_tuple__49)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22543 __Pyx_GOTREF(__pyx_tuple__49);
22544 __Pyx_GIVEREF(__pyx_tuple__49);
22545 __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(26, 0, 51, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_RE_NCP1_getElementJacobian, 574, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__50)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22554 __pyx_tuple__51 = PyTuple_Pack(9, __pyx_n_s_mt, __pyx_n_s_w, __pyx_n_s_dV, __pyx_n_s_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_mt_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__51)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22555 __Pyx_GOTREF(__pyx_tuple__51);
22556 __Pyx_GIVEREF(__pyx_tuple__51);
22557 __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_updateMass_weakAvg, 673, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__52)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22566 __pyx_tuple__53 = PyTuple_Pack(11, __pyx_n_s_dmt, __pyx_n_s_w, __pyx_n_s_v, __pyx_n_s_dV, __pyx_n_s_jacobian_weak_residual, __pyx_n_s_eN, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_k, __pyx_n_s_dmtj_avg, __pyx_n_s_vol);
if (unlikely(!__pyx_tuple__53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22567 __Pyx_GOTREF(__pyx_tuple__53);
22568 __Pyx_GIVEREF(__pyx_tuple__53);
22569 __pyx_codeobj__54 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_updateMassJacobian_weakAvg, 692, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22578 __pyx_tuple__55 = PyTuple_Pack(9, __pyx_n_s_v, __pyx_n_s_n, __pyx_n_s_dS, __pyx_n_s_flux, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_kb, __pyx_n_s_integral, __pyx_n_s_I);
if (unlikely(!__pyx_tuple__55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22579 __Pyx_GOTREF(__pyx_tuple__55);
22580 __Pyx_GIVEREF(__pyx_tuple__55);
22581 __pyx_codeobj__56 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__55, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_calculateNormalFlux, 717, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__56)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22590 __pyx_tuple__57 = PyTuple_Pack(9, __pyx_n_s_df, __pyx_n_s_characteristic_velocity, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_I, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__57)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22591 __Pyx_GOTREF(__pyx_tuple__57);
22592 __Pyx_GIVEREF(__pyx_tuple__57);
22593 __pyx_codeobj__58 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_computeSimpleCharacteristicVeloc, 732, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22602 __pyx_tuple__59 = PyTuple_Pack(11, __pyx_n_s_df_dofs, __pyx_n_s_characteristic_velocity_dofs, __pyx_n_s_l2g, __pyx_n_s_dm, __pyx_n_s_dV, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_J, __pyx_n_s_omega_e, __pyx_n_s_vol_e);
if (unlikely(!__pyx_tuple__59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22603 __Pyx_GOTREF(__pyx_tuple__59);
22604 __Pyx_GIVEREF(__pyx_tuple__59);
22605 __pyx_codeobj__60 = (PyObject*)__Pyx_PyCode_New(5, 0, 11, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__59, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_computeSimpleCharacteristicVeloc_2, 753, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22614 __pyx_tuple__61 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22615 __Pyx_GOTREF(__pyx_tuple__61);
22616 __Pyx_GIVEREF(__pyx_tuple__61);
22617 __pyx_codeobj__62 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__61, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_rotatingGaussianElementVelocityE, 776, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22626 __pyx_tuple__63 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_zvelocity, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22627 __Pyx_GOTREF(__pyx_tuple__63);
22628 __Pyx_GIVEREF(__pyx_tuple__63);
22629 __pyx_codeobj__64 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__63, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_rotatingGaussianElementVelocityE_2, 816, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22638 __pyx_tuple__65 = PyTuple_Pack(12, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22639 __Pyx_GOTREF(__pyx_tuple__65);
22640 __Pyx_GIVEREF(__pyx_tuple__65);
22641 __pyx_codeobj__66 = (PyObject*)__Pyx_PyCode_New(9, 0, 12, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_helicalElementVelocityEval3, 859, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__66)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22650 __pyx_tuple__67 = PyTuple_Pack(13, __pyx_n_s_transient, __pyx_n_s_t, __pyx_n_s_tForReversal, __pyx_n_s_clock, __pyx_n_s_zVelocity, __pyx_n_s_xc, __pyx_n_s_yc, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_ebN, __pyx_n_s_k, __pyx_n_s_pi);
if (unlikely(!__pyx_tuple__67)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22651 __Pyx_GOTREF(__pyx_tuple__67);
22652 __Pyx_GIVEREF(__pyx_tuple__67);
22653 __pyx_codeobj__68 = (PyObject*)__Pyx_PyCode_New(9, 0, 13, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_helicalElementVelocityEval4, 884, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__68)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22662 __pyx_tuple__69 = PyTuple_Pack(7, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__69)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22663 __Pyx_GOTREF(__pyx_tuple__69);
22664 __Pyx_GIVEREF(__pyx_tuple__69);
22665 __pyx_codeobj__70 = (PyObject*)__Pyx_PyCode_New(3, 0, 7, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_vortexElementVelocityEval3, 911, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__70)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22674 __pyx_tuple__71 = PyTuple_Pack(8, __pyx_n_s_t, __pyx_n_s_x, __pyx_n_s_v, __pyx_n_s_eN, __pyx_n_s_k, __pyx_n_s_ebN, __pyx_n_s_pi, __pyx_n_s_one8);
if (unlikely(!__pyx_tuple__71)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22675 __Pyx_GOTREF(__pyx_tuple__71);
22676 __Pyx_GIVEREF(__pyx_tuple__71);
22677 __pyx_codeobj__72 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__71, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_home_cekees_proteus_proteus_sub, __pyx_n_s_vortexElementVelocityEval4, 924, __pyx_empty_bytes);
if (unlikely(!__pyx_codeobj__72)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22678 __Pyx_RefNannyFinishContext();
22681 __Pyx_RefNannyFinishContext();
22685 static int __Pyx_InitGlobals(
void) {
22686 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
22687 __pyx_float_0_0 = PyFloat_FromDouble(0.0);
if (unlikely(!__pyx_float_0_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22688 __pyx_float_0_5 = PyFloat_FromDouble(0.5);
if (unlikely(!__pyx_float_0_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22689 __pyx_float_2_0 = PyFloat_FromDouble(2.0);
if (unlikely(!__pyx_float_2_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22690 __pyx_float_1_0eneg_20 = PyFloat_FromDouble(1.0e-20);
if (unlikely(!__pyx_float_1_0eneg_20)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22696 #if PY_MAJOR_VERSION < 3
22704 PyObject *__pyx_t_1 = NULL;
22705 int __pyx_lineno = 0;
22706 const char *__pyx_filename = NULL;
22707 int __pyx_clineno = 0;
22708 __Pyx_RefNannyDeclarations
22709 #if CYTHON_REFNANNY
22710 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"refnanny");
22711 if (!__Pyx_RefNanny) {
22713 __Pyx_RefNanny = __Pyx_RefNannyImportAPI(
"Cython.Runtime.refnanny");
22714 if (!__Pyx_RefNanny)
22715 Py_FatalError(
"failed to import 'refnanny' module");
22718 __Pyx_RefNannySetupContext(
"PyMODINIT_FUNC PyInit_subsurfaceTransportFunctions(void)", 0);
22719 if (__Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22720 __pyx_empty_tuple = PyTuple_New(0);
if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22721 __pyx_empty_bytes = PyBytes_FromStringAndSize(
"", 0);
if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22722 #ifdef __Pyx_CyFunction_USED
22723 if (__pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22725 #ifdef __Pyx_FusedFunction_USED
22726 if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22728 #ifdef __Pyx_Coroutine_USED
22729 if (__pyx_Coroutine_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22731 #ifdef __Pyx_Generator_USED
22732 if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22734 #ifdef __Pyx_StopAsyncIteration_USED
22735 if (__pyx_StopAsyncIteration_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22739 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
22741 PyEval_InitThreads();
22745 #if PY_MAJOR_VERSION < 3
22746 __pyx_m = Py_InitModule4(
"subsurfaceTransportFunctions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
22748 __pyx_m = PyModule_Create(&__pyx_moduledef);
22750 if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22751 __pyx_d = PyModule_GetDict(__pyx_m);
if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22752 Py_INCREF(__pyx_d);
22753 __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME);
if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22754 #if CYTHON_COMPILING_IN_PYPY
22755 Py_INCREF(__pyx_b);
22757 if (PyObject_SetAttrString(__pyx_m,
"__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;};
22759 if (__Pyx_InitGlobals() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22760 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
22761 if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22763 if (__pyx_module_is_main_subsurfaceTransportFunctions) {
22764 if (PyObject_SetAttrString(__pyx_m,
"__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22766 #if PY_MAJOR_VERSION >= 3
22768 PyObject *modules = PyImport_GetModuleDict();
if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22769 if (!PyDict_GetItemString(modules,
"subsurfaceTransportFunctions")) {
22770 if (unlikely(PyDict_SetItemString(modules,
"subsurfaceTransportFunctions", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22775 if (__Pyx_InitCachedBuiltins() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22777 if (__Pyx_InitCachedConstants() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22783 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME,
"type",
22784 #
if CYTHON_COMPILING_IN_PYPY
22785 sizeof(PyTypeObject),
22787 sizeof(PyHeapTypeObject),
22789 0);
if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22790 __pyx_ptype_5numpy_dtype = __Pyx_ImportType(
"numpy",
"dtype",
sizeof(PyArray_Descr), 0);
if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22791 __pyx_ptype_5numpy_flatiter = __Pyx_ImportType(
"numpy",
"flatiter",
sizeof(PyArrayIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 168; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22792 __pyx_ptype_5numpy_broadcast = __Pyx_ImportType(
"numpy",
"broadcast",
sizeof(PyArrayMultiIterObject), 0);
if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 172; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22793 __pyx_ptype_5numpy_ndarray = __Pyx_ImportType(
"numpy",
"ndarray",
sizeof(PyArrayObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 181; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22794 __pyx_ptype_5numpy_ufunc = __Pyx_ImportType(
"numpy",
"ufunc",
sizeof(PyUFuncObject), 0);
if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22798 #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
22799 if (__Pyx_patch_abc() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22807 __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22808 __Pyx_GOTREF(__pyx_t_1);
22809 if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22810 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22819 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_1setExteriorElementBoundaryTypes, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22820 __Pyx_GOTREF(__pyx_t_1);
22821 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setExteriorElementBoundaryTypes, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 18; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22822 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22831 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_3setElementBoundariesArray, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22832 __Pyx_GOTREF(__pyx_t_1);
22833 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setElementBoundariesArray, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 29; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22834 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22843 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_5setScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22844 __Pyx_GOTREF(__pyx_t_1);
22845 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22846 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22855 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_7setVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22856 __Pyx_GOTREF(__pyx_t_1);
22857 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setVectorMaterialFunctionOverEle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22858 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22867 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_9setScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22868 __Pyx_GOTREF(__pyx_t_1);
22869 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverEle_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22870 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22879 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_11setSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22880 __Pyx_GOTREF(__pyx_t_1);
22881 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22882 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22891 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_13setScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22892 __Pyx_GOTREF(__pyx_t_1);
22893 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setScalarMaterialFunctionOverGlo, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 118; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22894 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22903 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_15setSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22904 __Pyx_GOTREF(__pyx_t_1);
22905 if (PyDict_SetItem(__pyx_d, __pyx_n_s_setSparseTensorMaterialFunctionO_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22906 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22915 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_17evaluateScalarMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22916 __Pyx_GOTREF(__pyx_t_1);
22917 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22918 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22927 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_19evaluateVectorMaterialFunctionOverElements, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22928 __Pyx_GOTREF(__pyx_t_1);
22929 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateVectorMaterialFunctionOv, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22930 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22939 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_21evaluateScalarMaterialFunctionOverElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22940 __Pyx_GOTREF(__pyx_t_1);
22941 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22942 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22951 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_23evaluateSparseTensorMaterialFunctionOverElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22952 __Pyx_GOTREF(__pyx_t_1);
22953 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22954 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22963 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_25evaluateScalarMaterialFunctionOverGlobalElementBoundaries_arithmeticAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22964 __Pyx_GOTREF(__pyx_t_1);
22965 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateScalarMaterialFunctionOv_3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 248; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22966 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22975 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_27evaluateSparseTensorMaterialFunctionOverGlobalElementBoundaries_harmonicAverage, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22976 __Pyx_GOTREF(__pyx_t_1);
22977 if (PyDict_SetItem(__pyx_d, __pyx_n_s_evaluateSparseTensorMaterialFunc_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 271; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22978 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22987 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_29RE_NCP1_evaluateElementCoefficients_Linear, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22988 __Pyx_GOTREF(__pyx_t_1);
22989 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
22990 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
22999 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_31RE_NCP1_evaluateElementCoefficients_VGM, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23000 __Pyx_GOTREF(__pyx_t_1);
23001 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_evaluateElementCoefficie_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 359; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23002 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23011 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_33RE_NCP1_getElementResidual, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23012 __Pyx_GOTREF(__pyx_t_1);
23013 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementResidual, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 486; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23014 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23023 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_35RE_NCP1_getElementJacobian, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23024 __Pyx_GOTREF(__pyx_t_1);
23025 if (PyDict_SetItem(__pyx_d, __pyx_n_s_RE_NCP1_getElementJacobian, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 574; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23026 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23035 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_37updateMass_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23036 __Pyx_GOTREF(__pyx_t_1);
23037 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMass_weakAvg, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 673; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23038 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23047 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_39updateMassJacobian_weakAvg, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23048 __Pyx_GOTREF(__pyx_t_1);
23049 if (PyDict_SetItem(__pyx_d, __pyx_n_s_updateMassJacobian_weakAvg, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 692; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23050 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23059 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_41calculateNormalFlux, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23060 __Pyx_GOTREF(__pyx_t_1);
23061 if (PyDict_SetItem(__pyx_d, __pyx_n_s_calculateNormalFlux, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 717; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23062 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23071 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_43computeSimpleCharacteristicVelocityFromElementVelocity, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23072 __Pyx_GOTREF(__pyx_t_1);
23073 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 732; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23074 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23083 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_45computeSimpleCharacteristicVelocityFromVelocityDOFs, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23084 __Pyx_GOTREF(__pyx_t_1);
23085 if (PyDict_SetItem(__pyx_d, __pyx_n_s_computeSimpleCharacteristicVeloc_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23086 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23095 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_47rotatingGaussianElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23096 __Pyx_GOTREF(__pyx_t_1);
23097 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 776; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23098 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23107 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_49rotatingGaussianElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23108 __Pyx_GOTREF(__pyx_t_1);
23109 if (PyDict_SetItem(__pyx_d, __pyx_n_s_rotatingGaussianElementVelocityE_2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 816; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23110 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23119 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_51helicalElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23120 __Pyx_GOTREF(__pyx_t_1);
23121 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23122 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23131 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_53helicalElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23132 __Pyx_GOTREF(__pyx_t_1);
23133 if (PyDict_SetItem(__pyx_d, __pyx_n_s_helicalElementVelocityEval4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 884; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23134 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23143 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_55vortexElementVelocityEval3, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23144 __Pyx_GOTREF(__pyx_t_1);
23145 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval3, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 911; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23146 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23155 __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_28subsurfaceTransportFunctions_57vortexElementVelocityEval4, NULL, __pyx_n_s_subsurfaceTransportFunctions);
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23156 __Pyx_GOTREF(__pyx_t_1);
23157 if (PyDict_SetItem(__pyx_d, __pyx_n_s_vortexElementVelocityEval4, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 924; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23158 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23165 __pyx_t_1 = PyDict_New();
if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23166 __Pyx_GOTREF(__pyx_t_1);
23167 if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__;
goto __pyx_L1_error;}
23168 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23182 __Pyx_XDECREF(__pyx_t_1);
23185 __Pyx_AddTraceback(
"init subsurfaceTransportFunctions", __pyx_clineno, __pyx_lineno, __pyx_filename);
23187 Py_DECREF(__pyx_m); __pyx_m = 0;
23188 }
else if (!PyErr_Occurred()) {
23189 PyErr_SetString(PyExc_ImportError,
"init subsurfaceTransportFunctions");
23192 __Pyx_RefNannyFinishContext();
23193 #if PY_MAJOR_VERSION < 3
23201 #if CYTHON_REFNANNY
23202 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(
const char *modname) {
23203 PyObject *m = NULL, *p = NULL;
23205 m = PyImport_ImportModule((
char *)modname);
23207 p = PyObject_GetAttrString(m, (
char *)
"RefNannyAPI");
23209 r = PyLong_AsVoidPtr(p);
23213 return (__Pyx_RefNannyAPIStruct *)r;
23217 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23218 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23219 if (unlikely(!result)) {
23220 PyErr_Format(PyExc_NameError,
23221 #
if PY_MAJOR_VERSION >= 3
23222 "name '%U' is not defined", name);
23224 "name '%.200s' is not defined", PyString_AS_STRING(name));
23230 static void __Pyx_RaiseArgtupleInvalid(
23231 const char* func_name,
23233 Py_ssize_t num_min,
23234 Py_ssize_t num_max,
23235 Py_ssize_t num_found)
23237 Py_ssize_t num_expected;
23238 const char *more_or_less;
23239 if (num_found < num_min) {
23240 num_expected = num_min;
23241 more_or_less =
"at least";
23243 num_expected = num_max;
23244 more_or_less =
"at most";
23247 more_or_less =
"exactly";
23249 PyErr_Format(PyExc_TypeError,
23250 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T
"d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T
"d given)",
23251 func_name, more_or_less, num_expected,
23252 (num_expected == 1) ?
"" :
"s", num_found);
23255 static void __Pyx_RaiseDoubleKeywordsError(
23256 const char* func_name,
23259 PyErr_Format(PyExc_TypeError,
23260 #
if PY_MAJOR_VERSION >= 3
23261 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23263 "%s() got multiple values for keyword argument '%s'", func_name,
23264 PyString_AsString(kw_name));
23268 static int __Pyx_ParseOptionalKeywords(
23270 PyObject **argnames[],
23272 PyObject *values[],
23273 Py_ssize_t num_pos_args,
23274 const char* function_name)
23276 PyObject *key = 0, *value = 0;
23277 Py_ssize_t pos = 0;
23279 PyObject*** first_kw_arg = argnames + num_pos_args;
23280 while (PyDict_Next(kwds, &pos, &key, &value)) {
23281 name = first_kw_arg;
23282 while (*name && (**name != key)) name++;
23284 values[name-argnames] = value;
23287 name = first_kw_arg;
23288 #if PY_MAJOR_VERSION < 3
23289 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23291 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23292 && _PyString_Eq(**name, key)) {
23293 values[name-argnames] = value;
23298 if (*name)
continue;
23300 PyObject*** argname = argnames;
23301 while (argname != first_kw_arg) {
23302 if ((**argname == key) || (
23303 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23304 && _PyString_Eq(**argname, key))) {
23305 goto arg_passed_twice;
23312 if (likely(PyUnicode_Check(key))) {
23314 int cmp = (**name == key) ? 0 :
23315 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23316 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23318 PyUnicode_Compare(**name, key);
23319 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23321 values[name-argnames] = value;
23326 if (*name)
continue;
23328 PyObject*** argname = argnames;
23329 while (argname != first_kw_arg) {
23330 int cmp = (**argname == key) ? 0 :
23331 #
if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23332 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23334 PyUnicode_Compare(**argname, key);
23335 if (cmp < 0 && unlikely(PyErr_Occurred()))
goto bad;
23336 if (cmp == 0)
goto arg_passed_twice;
23341 goto invalid_keyword_type;
23343 if (unlikely(PyDict_SetItem(kwds2, key, value)))
goto bad;
23345 goto invalid_keyword;
23350 __Pyx_RaiseDoubleKeywordsError(function_name, key);
23352 invalid_keyword_type:
23353 PyErr_Format(PyExc_TypeError,
23354 "%.200s() keywords must be strings", function_name);
23357 PyErr_Format(PyExc_TypeError,
23358 #
if PY_MAJOR_VERSION < 3
23359 "%.200s() got an unexpected keyword argument '%.200s'",
23360 function_name, PyString_AsString(key));
23362 "%s() got an unexpected keyword argument '%U'",
23363 function_name, key);
23369 static void __Pyx_RaiseArgumentTypeInvalid(
const char* name, PyObject *obj, PyTypeObject *type) {
23370 PyErr_Format(PyExc_TypeError,
23371 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
23372 name, type->tp_name, Py_TYPE(obj)->tp_name);
23374 static CYTHON_INLINE
int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type,
int none_allowed,
23375 const char *name,
int exact)
23377 if (unlikely(!type)) {
23378 PyErr_SetString(PyExc_SystemError,
"Missing type object");
23381 if (none_allowed && obj == Py_None)
return 1;
23383 if (likely(Py_TYPE(obj) == type))
return 1;
23384 #if PY_MAJOR_VERSION == 2
23385 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj)))
return 1;
23389 if (likely(PyObject_TypeCheck(obj, type)))
return 1;
23391 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
23395 static CYTHON_INLINE
int __Pyx_IsLittleEndian(
void) {
23396 unsigned int n = 1;
23397 return *(
unsigned char*)(&n) != 0;
23399 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
23400 __Pyx_BufFmt_StackElem* stack,
23401 __Pyx_TypeInfo* type) {
23402 stack[0].field = &ctx->root;
23403 stack[0].parent_offset = 0;
23404 ctx->root.type = type;
23405 ctx->root.name =
"buffer dtype";
23406 ctx->root.offset = 0;
23408 ctx->head->field = &ctx->root;
23409 ctx->fmt_offset = 0;
23410 ctx->head->parent_offset = 0;
23411 ctx->new_packmode =
'@';
23412 ctx->enc_packmode =
'@';
23413 ctx->new_count = 1;
23414 ctx->enc_count = 0;
23416 ctx->is_complex = 0;
23417 ctx->is_valid_array = 0;
23418 ctx->struct_alignment = 0;
23419 while (type->typegroup ==
'S') {
23421 ctx->head->field = type->fields;
23422 ctx->head->parent_offset = 0;
23423 type = type->fields->type;
23426 static int __Pyx_BufFmt_ParseNumber(
const char** ts) {
23428 const char* t = *ts;
23429 if (*t < '0' || *t >
'9') {
23432 count = *t++ -
'0';
23433 while (*t >=
'0' && *t <
'9') {
23435 count += *t++ -
'0';
23441 static int __Pyx_BufFmt_ExpectNumber(
const char **ts) {
23442 int number = __Pyx_BufFmt_ParseNumber(ts);
23444 PyErr_Format(PyExc_ValueError,\
23445 "Does not understand character buffer dtype format string ('%c')", **ts);
23448 static void __Pyx_BufFmt_RaiseUnexpectedChar(
char ch) {
23449 PyErr_Format(PyExc_ValueError,
23450 "Unexpected format string character: '%c'", ch);
23452 static const char* __Pyx_BufFmt_DescribeTypeChar(
char ch,
int is_complex) {
23454 case 'c':
return "'char'";
23455 case 'b':
return "'signed char'";
23456 case 'B':
return "'unsigned char'";
23457 case 'h':
return "'short'";
23458 case 'H':
return "'unsigned short'";
23459 case 'i':
return "'int'";
23460 case 'I':
return "'unsigned int'";
23461 case 'l':
return "'long'";
23462 case 'L':
return "'unsigned long'";
23463 case 'q':
return "'long long'";
23464 case 'Q':
return "'unsigned long long'";
23465 case 'f':
return (is_complex ?
"'complex float'" :
"'float'");
23466 case 'd':
return (is_complex ?
"'complex double'" :
"'double'");
23467 case 'g':
return (is_complex ?
"'complex long double'" :
"'long double'");
23468 case 'T':
return "a struct";
23469 case 'O':
return "Python object";
23470 case 'P':
return "a pointer";
23471 case 's':
case 'p':
return "a string";
23472 case 0:
return "end";
23473 default:
return "unparseable format string";
23476 static size_t __Pyx_BufFmt_TypeCharToStandardSize(
char ch,
int is_complex) {
23478 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23479 case 'h':
case 'H':
return 2;
23480 case 'i':
case 'I':
case 'l':
case 'L':
return 4;
23481 case 'q':
case 'Q':
return 8;
23482 case 'f':
return (is_complex ? 8 : 4);
23483 case 'd':
return (is_complex ? 16 : 8);
23485 PyErr_SetString(PyExc_ValueError,
"Python does not define a standard format string size for long double ('g')..");
23488 case 'O':
case 'P':
return sizeof(
void*);
23490 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23494 static size_t __Pyx_BufFmt_TypeCharToNativeSize(
char ch,
int is_complex) {
23496 case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23497 case 'h':
case 'H':
return sizeof(short);
23498 case 'i':
case 'I':
return sizeof(int);
23499 case 'l':
case 'L':
return sizeof(long);
23500 #ifdef HAVE_LONG_LONG
23501 case 'q':
case 'Q':
return sizeof(PY_LONG_LONG);
23503 case 'f':
return sizeof(float) * (is_complex ? 2 : 1);
23504 case 'd':
return sizeof(double) * (is_complex ? 2 : 1);
23505 case 'g':
return sizeof(
long double) * (is_complex ? 2 : 1);
23506 case 'O':
case 'P':
return sizeof(
void*);
23508 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23513 typedef struct {
char c;
short x; } __Pyx_st_short;
23514 typedef struct {
char c;
int x; } __Pyx_st_int;
23515 typedef struct {
char c;
long x; } __Pyx_st_long;
23516 typedef struct {
char c;
float x; } __Pyx_st_float;
23517 typedef struct {
char c;
double x; } __Pyx_st_double;
23518 typedef struct {
char c;
long double x; } __Pyx_st_longdouble;
23519 typedef struct {
char c;
void *x; } __Pyx_st_void_p;
23520 #ifdef HAVE_LONG_LONG
23521 typedef struct {
char c; PY_LONG_LONG x; } __Pyx_st_longlong;
23523 static size_t __Pyx_BufFmt_TypeCharToAlignment(
char ch, CYTHON_UNUSED
int is_complex) {
23525 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23526 case 'h':
case 'H':
return sizeof(__Pyx_st_short) -
sizeof(
short);
23527 case 'i':
case 'I':
return sizeof(__Pyx_st_int) -
sizeof(
int);
23528 case 'l':
case 'L':
return sizeof(__Pyx_st_long) -
sizeof(
long);
23529 #ifdef HAVE_LONG_LONG
23530 case 'q':
case 'Q':
return sizeof(__Pyx_st_longlong) -
sizeof(PY_LONG_LONG);
23532 case 'f':
return sizeof(__Pyx_st_float) -
sizeof(
float);
23533 case 'd':
return sizeof(__Pyx_st_double) -
sizeof(
double);
23534 case 'g':
return sizeof(__Pyx_st_longdouble) -
sizeof(
long double);
23535 case 'P':
case 'O':
return sizeof(__Pyx_st_void_p) -
sizeof(
void*);
23537 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23545 typedef struct {
short x;
char c; } __Pyx_pad_short;
23546 typedef struct {
int x;
char c; } __Pyx_pad_int;
23547 typedef struct {
long x;
char c; } __Pyx_pad_long;
23548 typedef struct {
float x;
char c; } __Pyx_pad_float;
23549 typedef struct {
double x;
char c; } __Pyx_pad_double;
23550 typedef struct {
long double x;
char c; } __Pyx_pad_longdouble;
23551 typedef struct {
void *x;
char c; } __Pyx_pad_void_p;
23552 #ifdef HAVE_LONG_LONG
23553 typedef struct { PY_LONG_LONG x;
char c; } __Pyx_pad_longlong;
23555 static size_t __Pyx_BufFmt_TypeCharToPadding(
char ch, CYTHON_UNUSED
int is_complex) {
23557 case '?':
case 'c':
case 'b':
case 'B':
case 's':
case 'p':
return 1;
23558 case 'h':
case 'H':
return sizeof(__Pyx_pad_short) -
sizeof(
short);
23559 case 'i':
case 'I':
return sizeof(__Pyx_pad_int) -
sizeof(
int);
23560 case 'l':
case 'L':
return sizeof(__Pyx_pad_long) -
sizeof(
long);
23561 #ifdef HAVE_LONG_LONG
23562 case 'q':
case 'Q':
return sizeof(__Pyx_pad_longlong) -
sizeof(PY_LONG_LONG);
23564 case 'f':
return sizeof(__Pyx_pad_float) -
sizeof(
float);
23565 case 'd':
return sizeof(__Pyx_pad_double) -
sizeof(
double);
23566 case 'g':
return sizeof(__Pyx_pad_longdouble) -
sizeof(
long double);
23567 case 'P':
case 'O':
return sizeof(__Pyx_pad_void_p) -
sizeof(
void*);
23569 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23573 static char __Pyx_BufFmt_TypeCharToGroup(
char ch,
int is_complex) {
23577 case 'b':
case 'h':
case 'i':
23578 case 'l':
case 'q':
case 's':
case 'p':
23580 case 'B':
case 'H':
case 'I':
case 'L':
case 'Q':
23582 case 'f':
case 'd':
case 'g':
23583 return (is_complex ?
'C' :
'R');
23589 __Pyx_BufFmt_RaiseUnexpectedChar(ch);
23594 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
23595 if (ctx->head == NULL || ctx->head->field == &ctx->root) {
23596 const char* expected;
23598 if (ctx->head == NULL) {
23602 expected = ctx->head->field->type->name;
23605 PyErr_Format(PyExc_ValueError,
23606 "Buffer dtype mismatch, expected %s%s%s but got %s",
23607 quote, expected, quote,
23608 __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
23610 __Pyx_StructField* field = ctx->head->field;
23611 __Pyx_StructField* parent = (ctx->head - 1)->field;
23612 PyErr_Format(PyExc_ValueError,
23613 "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
23614 field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
23615 parent->type->name, field->name);
23618 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
23620 size_t size, offset, arraysize = 1;
23621 if (ctx->enc_type == 0)
return 0;
23622 if (ctx->head->field->type->arraysize[0]) {
23624 if (ctx->enc_type ==
's' || ctx->enc_type ==
'p') {
23625 ctx->is_valid_array = ctx->head->field->type->ndim == 1;
23627 if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
23628 PyErr_Format(PyExc_ValueError,
23629 "Expected a dimension of size %zu, got %zu",
23630 ctx->head->field->type->arraysize[0], ctx->enc_count);
23634 if (!ctx->is_valid_array) {
23635 PyErr_Format(PyExc_ValueError,
"Expected %d dimensions, got %d",
23636 ctx->head->field->type->ndim, ndim);
23639 for (i = 0; i < ctx->head->field->type->ndim; i++) {
23640 arraysize *= ctx->head->field->type->arraysize[i];
23642 ctx->is_valid_array = 0;
23643 ctx->enc_count = 1;
23645 group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
23647 __Pyx_StructField* field = ctx->head->field;
23648 __Pyx_TypeInfo* type = field->type;
23649 if (ctx->enc_packmode ==
'@' || ctx->enc_packmode ==
'^') {
23650 size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
23652 size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
23654 if (ctx->enc_packmode ==
'@') {
23655 size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
23656 size_t align_mod_offset;
23657 if (align_at == 0)
return -1;
23658 align_mod_offset = ctx->fmt_offset % align_at;
23659 if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
23660 if (ctx->struct_alignment == 0)
23661 ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
23664 if (type->size != size || type->typegroup != group) {
23665 if (type->typegroup ==
'C' && type->fields != NULL) {
23666 size_t parent_offset = ctx->head->parent_offset + field->offset;
23668 ctx->head->field = type->fields;
23669 ctx->head->parent_offset = parent_offset;
23672 if ((type->typegroup ==
'H' || group ==
'H') && type->size == size) {
23674 __Pyx_BufFmt_RaiseExpected(ctx);
23678 offset = ctx->head->parent_offset + field->offset;
23679 if (ctx->fmt_offset != offset) {
23680 PyErr_Format(PyExc_ValueError,
23681 "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T
"d but %" CYTHON_FORMAT_SSIZE_T
"d expected",
23682 (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
23685 ctx->fmt_offset += size;
23687 ctx->fmt_offset += (arraysize - 1) * size;
23690 if (field == &ctx->root) {
23692 if (ctx->enc_count != 0) {
23693 __Pyx_BufFmt_RaiseExpected(ctx);
23698 ctx->head->field = ++field;
23699 if (field->type == NULL) {
23701 field = ctx->head->field;
23703 }
else if (field->type->typegroup ==
'S') {
23704 size_t parent_offset = ctx->head->parent_offset + field->offset;
23705 if (field->type->fields->type == NULL)
continue;
23706 field = field->type->fields;
23708 ctx->head->field = field;
23709 ctx->head->parent_offset = parent_offset;
23715 }
while (ctx->enc_count);
23717 ctx->is_complex = 0;
23720 static CYTHON_INLINE PyObject *
23721 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx,
const char** tsp)
23723 const char *ts = *tsp;
23725 int ndim = ctx->head->field->type->ndim;
23728 if (ctx->new_count != 1) {
23729 PyErr_SetString(PyExc_ValueError,
23730 "Cannot handle repeated arrays in format string");
23733 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23734 while (*ts && *ts !=
')') {
23736 case ' ':
case '\f':
case '\r':
case '\n':
case '\t':
case '\v':
continue;
23739 number = __Pyx_BufFmt_ExpectNumber(&ts);
23740 if (number == -1)
return NULL;
23741 if (i < ndim && (
size_t) number != ctx->head->field->type->arraysize[i])
23742 return PyErr_Format(PyExc_ValueError,
23743 "Expected a dimension of size %zu, got %d",
23744 ctx->head->field->type->arraysize[i], number);
23745 if (*ts !=
',' && *ts !=
')')
23746 return PyErr_Format(PyExc_ValueError,
23747 "Expected a comma in format string, got '%c'", *ts);
23748 if (*ts ==
',') ts++;
23752 return PyErr_Format(PyExc_ValueError,
"Expected %d dimension(s), got %d",
23753 ctx->head->field->type->ndim, i);
23755 PyErr_SetString(PyExc_ValueError,
23756 "Unexpected end of format string, expected ')'");
23759 ctx->is_valid_array = 1;
23760 ctx->new_count = 1;
23764 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx,
const char* ts) {
23769 if (ctx->enc_type != 0 && ctx->head == NULL) {
23770 __Pyx_BufFmt_RaiseExpected(ctx);
23773 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23774 if (ctx->head != NULL) {
23775 __Pyx_BufFmt_RaiseExpected(ctx);
23785 if (!__Pyx_IsLittleEndian()) {
23786 PyErr_SetString(PyExc_ValueError,
"Little-endian buffer not supported on big-endian compiler");
23789 ctx->new_packmode =
'=';
23794 if (__Pyx_IsLittleEndian()) {
23795 PyErr_SetString(PyExc_ValueError,
"Big-endian buffer not supported on little-endian compiler");
23798 ctx->new_packmode =
'=';
23804 ctx->new_packmode = *ts++;
23808 const char* ts_after_sub;
23809 size_t i, struct_count = ctx->new_count;
23810 size_t struct_alignment = ctx->struct_alignment;
23811 ctx->new_count = 1;
23814 PyErr_SetString(PyExc_ValueError,
"Buffer acquisition: Expected '{' after 'T'");
23817 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23819 ctx->enc_count = 0;
23820 ctx->struct_alignment = 0;
23823 for (i = 0; i != struct_count; ++i) {
23824 ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
23825 if (!ts_after_sub)
return NULL;
23828 if (struct_alignment) ctx->struct_alignment = struct_alignment;
23833 size_t alignment = ctx->struct_alignment;
23835 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23837 if (alignment && ctx->fmt_offset % alignment) {
23838 ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
23843 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23844 ctx->fmt_offset += ctx->new_count;
23845 ctx->new_count = 1;
23846 ctx->enc_count = 0;
23848 ctx->enc_packmode = ctx->new_packmode;
23854 if (*ts !=
'f' && *ts !=
'd' && *ts !=
'g') {
23855 __Pyx_BufFmt_RaiseUnexpectedChar(
'Z');
23858 case 'c':
case 'b':
case 'B':
case 'h':
case 'H':
case 'i':
case 'I':
23859 case 'l':
case 'L':
case 'q':
case 'Q':
23860 case 'f':
case 'd':
case 'g':
23861 case 'O':
case 'p':
23862 if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
23863 ctx->enc_packmode == ctx->new_packmode) {
23864 ctx->enc_count += ctx->new_count;
23865 ctx->new_count = 1;
23871 if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1)
return NULL;
23872 ctx->enc_count = ctx->new_count;
23873 ctx->enc_packmode = ctx->new_packmode;
23874 ctx->enc_type = *ts;
23875 ctx->is_complex = got_Z;
23877 ctx->new_count = 1;
23882 while(*ts !=
':') ++ts;
23886 if (!__pyx_buffmt_parse_array(ctx, &ts))
return NULL;
23890 int number = __Pyx_BufFmt_ExpectNumber(&ts);
23891 if (number == -1)
return NULL;
23892 ctx->new_count = (size_t)number;
23897 static CYTHON_INLINE
void __Pyx_ZeroBuffer(Py_buffer* buf) {
23900 buf->strides = __Pyx_zeros;
23901 buf->shape = __Pyx_zeros;
23902 buf->suboffsets = __Pyx_minusones;
23904 static CYTHON_INLINE
int __Pyx_GetBufferAndValidate(
23905 Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype,
int flags,
23906 int nd,
int cast, __Pyx_BufFmt_StackElem* stack)
23908 if (obj == Py_None || obj == NULL) {
23909 __Pyx_ZeroBuffer(buf);
23913 if (__Pyx_GetBuffer(obj, buf, flags) == -1)
goto fail;
23914 if (buf->ndim != nd) {
23915 PyErr_Format(PyExc_ValueError,
23916 "Buffer has wrong number of dimensions (expected %d, got %d)",
23921 __Pyx_BufFmt_Context ctx;
23922 __Pyx_BufFmt_Init(&ctx, stack, dtype);
23923 if (!__Pyx_BufFmt_CheckString(&ctx, buf->format))
goto fail;
23925 if ((
unsigned)buf->itemsize != dtype->size) {
23926 PyErr_Format(PyExc_ValueError,
23927 "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T
"d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T
"d byte%s)",
23928 buf->itemsize, (buf->itemsize > 1) ?
"s" :
"",
23929 dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ?
"s" :
"");
23932 if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
23935 __Pyx_ZeroBuffer(buf);
23938 static CYTHON_INLINE
void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
23939 if (info->buf == NULL)
return;
23940 if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
23941 __Pyx_ReleaseBuffer(info);
23944 static void __Pyx_RaiseBufferIndexError(
int axis) {
23945 PyErr_Format(PyExc_IndexError,
23946 "Out of bounds on buffer access (axis %d)", axis);
23949 static CYTHON_INLINE
void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
23950 #if CYTHON_COMPILING_IN_CPYTHON
23951 PyObject *tmp_type, *tmp_value, *tmp_tb;
23952 PyThreadState *tstate = PyThreadState_GET();
23953 tmp_type = tstate->curexc_type;
23954 tmp_value = tstate->curexc_value;
23955 tmp_tb = tstate->curexc_traceback;
23956 tstate->curexc_type = type;
23957 tstate->curexc_value = value;
23958 tstate->curexc_traceback = tb;
23959 Py_XDECREF(tmp_type);
23960 Py_XDECREF(tmp_value);
23961 Py_XDECREF(tmp_tb);
23963 PyErr_Restore(type, value, tb);
23966 static CYTHON_INLINE
void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
23967 #if CYTHON_COMPILING_IN_CPYTHON
23968 PyThreadState *tstate = PyThreadState_GET();
23969 *type = tstate->curexc_type;
23970 *value = tstate->curexc_value;
23971 *tb = tstate->curexc_traceback;
23972 tstate->curexc_type = 0;
23973 tstate->curexc_value = 0;
23974 tstate->curexc_traceback = 0;
23976 PyErr_Fetch(type, value, tb);
23980 #if CYTHON_USE_PYLONG_INTERNALS
23981 #include "longintrepr.h"
23984 #if CYTHON_COMPILING_IN_CPYTHON
23985 static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2,
double floatval, CYTHON_UNUSED
int inplace) {
23986 const double b = floatval;
23988 if (likely(PyFloat_CheckExact(op1))) {
23989 a = PyFloat_AS_DOUBLE(op1);
23991 #if PY_MAJOR_VERSION < 3
23992 if (likely(PyInt_CheckExact(op1))) {
23993 a = (double) PyInt_AS_LONG(op1);
23996 if (likely(PyLong_CheckExact(op1))) {
23997 #if CYTHON_USE_PYLONG_INTERNALS && PY_MAJOR_VERSION >= 3
23998 const digit* digits = ((PyLongObject*)op1)->ob_digit;
23999 const Py_ssize_t size = Py_SIZE(op1);
24001 case 0: a = 0.0;
break;
24002 case -1: a = -(double) digits[0];
break;
24003 case 1: a = (double) digits[0];
break;
24006 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
24007 a = (double) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24008 if ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
24016 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
24017 a = (double) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24018 if ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
24026 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT && ((8 *
sizeof(
unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
24027 a = (double) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0]));
24028 if ((8 *
sizeof(
unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) (1L<<53))) {
24038 a = PyLong_AsDouble(op1);
24039 if (unlikely(a == -1.0 && PyErr_Occurred()))
return NULL;
24042 return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
24044 PyFPE_START_PROTECT(
"add",
return NULL)
24046 PyFPE_END_PROTECT(result)
24047 return PyFloat_FromDouble(result);
24051 #if CYTHON_COMPILING_IN_CPYTHON
24052 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24054 ternaryfunc call = func->ob_type->tp_call;
24055 if (unlikely(!call))
24056 return PyObject_Call(func, arg, kw);
24057 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24059 result = (*call)(func, arg, kw);
24060 Py_LeaveRecursiveCall();
24061 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24064 "NULL result without error in PyObject_Call");
24070 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
24072 #if CYTHON_COMPILING_IN_CPYTHON
24073 result = PyDict_GetItem(__pyx_d, name);
24074 if (likely(result)) {
24078 result = PyObject_GetItem(__pyx_d, name);
24082 result = __Pyx_GetBuiltinName(name);
24087 static CYTHON_INLINE
int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
24088 if (unlikely(!type)) {
24089 PyErr_SetString(PyExc_SystemError,
"Missing type object");
24092 if (likely(PyObject_TypeCheck(obj, type)))
24094 PyErr_Format(PyExc_TypeError,
"Cannot convert %.200s to %.200s",
24095 Py_TYPE(obj)->tp_name, type->tp_name);
24099 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
24101 if (!j)
return NULL;
24102 r = PyObject_GetItem(o, j);
24106 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
24107 CYTHON_NCP_UNUSED
int wraparound,
24108 CYTHON_NCP_UNUSED
int boundscheck) {
24109 #if CYTHON_COMPILING_IN_CPYTHON
24110 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
24111 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
24112 PyObject *r = PyList_GET_ITEM(o, i);
24116 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24118 return PySequence_GetItem(o, i);
24121 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
24122 CYTHON_NCP_UNUSED
int wraparound,
24123 CYTHON_NCP_UNUSED
int boundscheck) {
24124 #if CYTHON_COMPILING_IN_CPYTHON
24125 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
24126 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
24127 PyObject *r = PyTuple_GET_ITEM(o, i);
24131 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24133 return PySequence_GetItem(o, i);
24136 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
int is_list,
24137 CYTHON_NCP_UNUSED
int wraparound,
24138 CYTHON_NCP_UNUSED
int boundscheck) {
24139 #if CYTHON_COMPILING_IN_CPYTHON
24140 if (is_list || PyList_CheckExact(o)) {
24141 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
24142 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
24143 PyObject *r = PyList_GET_ITEM(o, n);
24148 else if (PyTuple_CheckExact(o)) {
24149 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
24150 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
24151 PyObject *r = PyTuple_GET_ITEM(o, n);
24156 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
24157 if (likely(m && m->sq_item)) {
24158 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
24159 Py_ssize_t l = m->sq_length(o);
24160 if (likely(l >= 0)) {
24163 if (PyErr_ExceptionMatches(PyExc_OverflowError))
24169 return m->sq_item(o, i);
24173 if (is_list || PySequence_Check(o)) {
24174 return PySequence_GetItem(o, i);
24177 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
24180 #if CYTHON_COMPILING_IN_CPYTHON
24181 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24182 PyObject *
self, *result;
24184 cfunc = PyCFunction_GET_FUNCTION(func);
24185 self = PyCFunction_GET_SELF(func);
24186 if (unlikely(Py_EnterRecursiveCall((
char*)
" while calling a Python object")))
24188 result = cfunc(
self, arg);
24189 Py_LeaveRecursiveCall();
24190 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24193 "NULL result without error in PyObject_Call");
24199 #if CYTHON_COMPILING_IN_CPYTHON
24200 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24202 PyObject *args = PyTuple_New(1);
24203 if (unlikely(!args))
return NULL;
24205 PyTuple_SET_ITEM(args, 0, arg);
24206 result = __Pyx_PyObject_Call(func, args, NULL);
24210 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24211 #ifdef __Pyx_CyFunction_USED
24212 if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
24214 if (likely(PyCFunction_Check(func))) {
24216 if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24217 return __Pyx_PyObject_CallMethO(func, arg);
24220 return __Pyx__PyObject_CallOneArg(func, arg);
24223 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24224 PyObject* args = PyTuple_Pack(1, arg);
24225 return (likely(args)) ? __Pyx_PyObject_Call(func, args, NULL) : NULL;
24229 static double __Pyx__PyObject_AsDouble(PyObject* obj) {
24230 PyObject* float_value;
24231 #if CYTHON_COMPILING_IN_PYPY
24232 float_value = PyNumber_Float(obj);
if (0)
goto bad;
24234 PyNumberMethods *nb = Py_TYPE(obj)->tp_as_number;
24235 if (likely(nb) && likely(nb->nb_float)) {
24236 float_value = nb->nb_float(obj);
24237 if (likely(float_value) && unlikely(!PyFloat_Check(float_value))) {
24238 PyErr_Format(PyExc_TypeError,
24239 "__float__ returned non-float (type %.200s)",
24240 Py_TYPE(float_value)->tp_name);
24241 Py_DECREF(float_value);
24244 }
else if (PyUnicode_CheckExact(obj) || PyBytes_CheckExact(obj)) {
24245 #if PY_MAJOR_VERSION >= 3
24246 float_value = PyFloat_FromString(obj);
24248 float_value = PyFloat_FromString(obj, 0);
24251 PyObject* args = PyTuple_New(1);
24252 if (unlikely(!args))
goto bad;
24253 PyTuple_SET_ITEM(args, 0, obj);
24254 float_value = PyObject_Call((PyObject*)&PyFloat_Type, args, 0);
24255 PyTuple_SET_ITEM(args, 0, 0);
24259 if (likely(float_value)) {
24260 double value = PyFloat_AS_DOUBLE(float_value);
24261 Py_DECREF(float_value);
24268 #if PY_MAJOR_VERSION < 3
24269 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24270 CYTHON_UNUSED PyObject *cause) {
24272 if (!value || value == Py_None)
24276 if (!tb || tb == Py_None)
24280 if (!PyTraceBack_Check(tb)) {
24281 PyErr_SetString(PyExc_TypeError,
24282 "raise: arg 3 must be a traceback or None");
24286 if (PyType_Check(type)) {
24287 #if CYTHON_COMPILING_IN_PYPY
24289 Py_INCREF(Py_None);
24293 PyErr_NormalizeException(&type, &value, &tb);
24296 PyErr_SetString(PyExc_TypeError,
24297 "instance exception may not have a separate value");
24301 type = (PyObject*) Py_TYPE(type);
24303 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24304 PyErr_SetString(PyExc_TypeError,
24305 "raise: exception class must be a subclass of BaseException");
24309 __Pyx_ErrRestore(type, value, tb);
24318 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
24319 PyObject* owned_instance = NULL;
24320 if (tb == Py_None) {
24322 }
else if (tb && !PyTraceBack_Check(tb)) {
24323 PyErr_SetString(PyExc_TypeError,
24324 "raise: arg 3 must be a traceback or None");
24327 if (value == Py_None)
24329 if (PyExceptionInstance_Check(type)) {
24331 PyErr_SetString(PyExc_TypeError,
24332 "instance exception may not have a separate value");
24336 type = (PyObject*) Py_TYPE(value);
24337 }
else if (PyExceptionClass_Check(type)) {
24338 PyObject *instance_class = NULL;
24339 if (value && PyExceptionInstance_Check(value)) {
24340 instance_class = (PyObject*) Py_TYPE(value);
24341 if (instance_class != type) {
24342 int is_subclass = PyObject_IsSubclass(instance_class, type);
24343 if (!is_subclass) {
24344 instance_class = NULL;
24345 }
else if (unlikely(is_subclass == -1)) {
24348 type = instance_class;
24352 if (!instance_class) {
24355 args = PyTuple_New(0);
24356 else if (PyTuple_Check(value)) {
24360 args = PyTuple_Pack(1, value);
24363 owned_instance = PyObject_Call(type, args, NULL);
24365 if (!owned_instance)
24367 value = owned_instance;
24368 if (!PyExceptionInstance_Check(value)) {
24369 PyErr_Format(PyExc_TypeError,
24370 "calling %R should have returned an instance of "
24371 "BaseException, not %R",
24372 type, Py_TYPE(value));
24377 PyErr_SetString(PyExc_TypeError,
24378 "raise: exception class must be a subclass of BaseException");
24381 #if PY_VERSION_HEX >= 0x03030000
24384 if (cause && cause != Py_None) {
24386 PyObject *fixed_cause;
24387 if (cause == Py_None) {
24388 fixed_cause = NULL;
24389 }
else if (PyExceptionClass_Check(cause)) {
24390 fixed_cause = PyObject_CallObject(cause, NULL);
24391 if (fixed_cause == NULL)
24393 }
else if (PyExceptionInstance_Check(cause)) {
24394 fixed_cause = cause;
24395 Py_INCREF(fixed_cause);
24397 PyErr_SetString(PyExc_TypeError,
24398 "exception causes must derive from "
24402 PyException_SetCause(value, fixed_cause);
24404 PyErr_SetObject(type, value);
24406 #if CYTHON_COMPILING_IN_PYPY
24407 PyObject *tmp_type, *tmp_value, *tmp_tb;
24408 PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
24410 PyErr_Restore(tmp_type, tmp_value, tb);
24411 Py_XDECREF(tmp_tb);
24413 PyThreadState *tstate = PyThreadState_GET();
24414 PyObject* tmp_tb = tstate->curexc_traceback;
24415 if (tb != tmp_tb) {
24417 tstate->curexc_traceback = tb;
24418 Py_XDECREF(tmp_tb);
24423 Py_XDECREF(owned_instance);
24428 static CYTHON_INLINE
void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
24429 PyErr_Format(PyExc_ValueError,
24430 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T
"d)", expected);
24433 static CYTHON_INLINE
void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
24434 PyErr_Format(PyExc_ValueError,
24435 "need more than %" CYTHON_FORMAT_SSIZE_T
"d value%.1s to unpack",
24436 index, (index == 1) ?
"" :
"s");
24439 static CYTHON_INLINE
void __Pyx_RaiseNoneNotIterableError(
void) {
24440 PyErr_SetString(PyExc_TypeError,
"'NoneType' object is not iterable");
24443 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list,
int level) {
24444 PyObject *empty_list = 0;
24445 PyObject *module = 0;
24446 PyObject *global_dict = 0;
24447 PyObject *empty_dict = 0;
24449 #if PY_VERSION_HEX < 0x03030000
24450 PyObject *py_import;
24451 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
24458 empty_list = PyList_New(0);
24463 global_dict = PyModule_GetDict(__pyx_m);
24466 empty_dict = PyDict_New();
24470 #if PY_MAJOR_VERSION >= 3
24472 if (strchr(__Pyx_MODULE_NAME,
'.')) {
24473 #if PY_VERSION_HEX < 0x03030000
24474 PyObject *py_level = PyInt_FromLong(1);
24477 module = PyObject_CallFunctionObjArgs(py_import,
24478 name, global_dict, empty_dict, list, py_level, NULL);
24479 Py_DECREF(py_level);
24481 module = PyImport_ImportModuleLevelObject(
24482 name, global_dict, empty_dict, list, 1);
24485 if (!PyErr_ExceptionMatches(PyExc_ImportError))
24494 #if PY_VERSION_HEX < 0x03030000
24495 PyObject *py_level = PyInt_FromLong(level);
24498 module = PyObject_CallFunctionObjArgs(py_import,
24499 name, global_dict, empty_dict, list, py_level, NULL);
24500 Py_DECREF(py_level);
24502 module = PyImport_ImportModuleLevelObject(
24503 name, global_dict, empty_dict, list, level);
24508 #if PY_VERSION_HEX < 0x03030000
24509 Py_XDECREF(py_import);
24511 Py_XDECREF(empty_list);
24512 Py_XDECREF(empty_dict);
24516 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries,
int count,
int code_line) {
24517 int start = 0, mid = 0, end = count - 1;
24518 if (end >= 0 && code_line > entries[end].code_line) {
24521 while (start < end) {
24522 mid = start + (end - start) / 2;
24523 if (code_line < entries[mid].code_line) {
24525 }
else if (code_line > entries[mid].code_line) {
24531 if (code_line <= entries[mid].code_line) {
24537 static PyCodeObject *__pyx_find_code_object(
int code_line) {
24538 PyCodeObject* code_object;
24540 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
24543 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24544 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
24547 code_object = __pyx_code_cache.entries[pos].code_object;
24548 Py_INCREF(code_object);
24549 return code_object;
24551 static void __pyx_insert_code_object(
int code_line, PyCodeObject* code_object) {
24553 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
24554 if (unlikely(!code_line)) {
24557 if (unlikely(!entries)) {
24558 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*
sizeof(__Pyx_CodeObjectCacheEntry));
24559 if (likely(entries)) {
24560 __pyx_code_cache.entries = entries;
24561 __pyx_code_cache.max_count = 64;
24562 __pyx_code_cache.count = 1;
24563 entries[0].code_line = code_line;
24564 entries[0].code_object = code_object;
24565 Py_INCREF(code_object);
24569 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
24570 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
24571 PyCodeObject* tmp = entries[pos].code_object;
24572 entries[pos].code_object = code_object;
24576 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
24577 int new_max = __pyx_code_cache.max_count + 64;
24578 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
24579 __pyx_code_cache.entries, (
size_t)new_max*
sizeof(__Pyx_CodeObjectCacheEntry));
24580 if (unlikely(!entries)) {
24583 __pyx_code_cache.entries = entries;
24584 __pyx_code_cache.max_count = new_max;
24586 for (i=__pyx_code_cache.count; i>pos; i--) {
24587 entries[i] = entries[i-1];
24589 entries[pos].code_line = code_line;
24590 entries[pos].code_object = code_object;
24591 __pyx_code_cache.count++;
24592 Py_INCREF(code_object);
24595 #include "compile.h"
24596 #include "frameobject.h"
24597 #include "traceback.h"
24598 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
24599 const char *funcname,
int c_line,
24600 int py_line,
const char *filename) {
24601 PyCodeObject *py_code = 0;
24602 PyObject *py_srcfile = 0;
24603 PyObject *py_funcname = 0;
24604 #if PY_MAJOR_VERSION < 3
24605 py_srcfile = PyString_FromString(filename);
24607 py_srcfile = PyUnicode_FromString(filename);
24609 if (!py_srcfile)
goto bad;
24611 #if PY_MAJOR_VERSION < 3
24612 py_funcname = PyString_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24614 py_funcname = PyUnicode_FromFormat(
"%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
24618 #if PY_MAJOR_VERSION < 3
24619 py_funcname = PyString_FromString(funcname);
24621 py_funcname = PyUnicode_FromString(funcname);
24624 if (!py_funcname)
goto bad;
24625 py_code = __Pyx_PyCode_New(
24642 Py_DECREF(py_srcfile);
24643 Py_DECREF(py_funcname);
24646 Py_XDECREF(py_srcfile);
24647 Py_XDECREF(py_funcname);
24650 static void __Pyx_AddTraceback(
const char *funcname,
int c_line,
24651 int py_line,
const char *filename) {
24652 PyCodeObject *py_code = 0;
24653 PyFrameObject *py_frame = 0;
24654 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
24656 py_code = __Pyx_CreateCodeObjectForTraceback(
24657 funcname, c_line, py_line, filename);
24658 if (!py_code)
goto bad;
24659 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
24661 py_frame = PyFrame_New(
24662 PyThreadState_GET(),
24667 if (!py_frame)
goto bad;
24668 py_frame->f_lineno = py_line;
24669 PyTraceBack_Here(py_frame);
24671 Py_XDECREF(py_code);
24672 Py_XDECREF(py_frame);
24675 #if PY_MAJOR_VERSION < 3
24676 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view,
int flags) {
24677 if (PyObject_CheckBuffer(obj))
return PyObject_GetBuffer(obj, view, flags);
24678 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray))
return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
24679 PyErr_Format(PyExc_TypeError,
"'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
24682 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
24683 PyObject *obj = view->obj;
24685 if (PyObject_CheckBuffer(obj)) {
24686 PyBuffer_Release(view);
24689 if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
return; }
24696 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
24697 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
24698 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
24699 __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
24700 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
24702 func_type value = func_value;\
24703 if (sizeof(target_type) < sizeof(func_type)) {\
24704 if (unlikely(value != (func_type) (target_type) value)) {\
24705 func_type zero = 0;\
24706 if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
24707 return (target_type) -1;\
24708 if (is_unsigned && unlikely(value < zero))\
24709 goto raise_neg_overflow;\
24711 goto raise_overflow;\
24714 return (target_type) value;\
24717 static CYTHON_INLINE
int __Pyx_PyInt_As_int(PyObject *x) {
24718 const int neg_one = (int) -1, const_zero = (
int) 0;
24719 const int is_unsigned = neg_one > const_zero;
24720 #if PY_MAJOR_VERSION < 3
24721 if (likely(PyInt_Check(x))) {
24722 if (
sizeof(
int) <
sizeof(long)) {
24723 __PYX_VERIFY_RETURN_INT(
int,
long, PyInt_AS_LONG(x))
24725 long val = PyInt_AS_LONG(x);
24726 if (is_unsigned && unlikely(val < 0)) {
24727 goto raise_neg_overflow;
24733 if (likely(PyLong_Check(x))) {
24735 #if CYTHON_USE_PYLONG_INTERNALS
24736 const digit* digits = ((PyLongObject*)x)->ob_digit;
24737 switch (Py_SIZE(x)) {
24738 case 0:
return (
int) 0;
24739 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, digits[0])
24741 if (8 * sizeof(
int) > 1 * PyLong_SHIFT) {
24742 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24743 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24744 }
else if (8 *
sizeof(
int) >= 2 * PyLong_SHIFT) {
24745 return (
int) (((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
24750 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
24751 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24752 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24753 }
else if (8 *
sizeof(
int) >= 3 * PyLong_SHIFT) {
24754 return (
int) (((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
24759 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
24760 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24761 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24762 }
else if (8 *
sizeof(
int) >= 4 * PyLong_SHIFT) {
24763 return (
int) (((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0]));
24769 #if CYTHON_COMPILING_IN_CPYTHON
24770 if (unlikely(Py_SIZE(x) < 0)) {
24771 goto raise_neg_overflow;
24775 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
24776 if (unlikely(result < 0))
24778 if (unlikely(result == 1))
24779 goto raise_neg_overflow;
24782 if (
sizeof(
int) <=
sizeof(
unsigned long)) {
24783 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned long, PyLong_AsUnsignedLong(x))
24784 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
24785 __PYX_VERIFY_RETURN_INT_EXC(
int,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
24788 #if CYTHON_USE_PYLONG_INTERNALS
24789 const digit* digits = ((PyLongObject*)x)->ob_digit;
24790 switch (Py_SIZE(x)) {
24791 case 0:
return (
int) 0;
24792 case -1: __PYX_VERIFY_RETURN_INT(
int, sdigit, -(sdigit) digits[0])
24793 case 1: __PYX_VERIFY_RETURN_INT(
int, digit, +digits[0])
24795 if (8 * sizeof(
int) - 1 > 1 * PyLong_SHIFT) {
24796 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24797 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24798 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24799 return (
int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24804 if (8 *
sizeof(
int) > 1 * PyLong_SHIFT) {
24805 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24806 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24807 }
else if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24808 return (
int) ((((((int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24813 if (8 *
sizeof(
int) - 1 > 2 * PyLong_SHIFT) {
24814 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24815 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24816 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24817 return (
int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24822 if (8 *
sizeof(
int) > 2 * PyLong_SHIFT) {
24823 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24824 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24825 }
else if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24826 return (
int) ((((((((int)digits[2]) << PyLong_SHIFT) | (
int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
24831 if (8 *
sizeof(
int) - 1 > 3 * PyLong_SHIFT) {
24832 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24833 __PYX_VERIFY_RETURN_INT(
int,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24834 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24835 return (
int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24840 if (8 *
sizeof(
int) > 3 * PyLong_SHIFT) {
24841 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24842 __PYX_VERIFY_RETURN_INT(
int,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24843 }
else if (8 *
sizeof(
int) - 1 > 4 * PyLong_SHIFT) {
24844 return (
int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (
int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (
int)digits[0])));
24850 if (
sizeof(
int) <=
sizeof(long)) {
24851 __PYX_VERIFY_RETURN_INT_EXC(
int,
long, PyLong_AsLong(x))
24852 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24853 __PYX_VERIFY_RETURN_INT_EXC(
int, PY_LONG_LONG, PyLong_AsLongLong(x))
24857 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
24858 PyErr_SetString(PyExc_RuntimeError,
24859 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
24862 PyObject *v = __Pyx_PyNumber_Int(x);
24863 #if PY_MAJOR_VERSION < 3
24864 if (likely(v) && !PyLong_Check(v)) {
24866 v = PyNumber_Long(tmp);
24871 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
24872 unsigned char *bytes = (
unsigned char *)&val;
24873 int ret = _PyLong_AsByteArray((PyLongObject *)v,
24874 bytes,
sizeof(val),
24875 is_little, !is_unsigned);
24885 PyObject *tmp = __Pyx_PyNumber_Int(x);
24886 if (!tmp)
return (
int) -1;
24887 val = __Pyx_PyInt_As_int(tmp);
24892 PyErr_SetString(PyExc_OverflowError,
24893 "value too large to convert to int");
24895 raise_neg_overflow:
24896 PyErr_SetString(PyExc_OverflowError,
24897 "can't convert negative value to int");
24901 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(
int value) {
24902 const int neg_one = (int) -1, const_zero = (
int) 0;
24903 const int is_unsigned = neg_one > const_zero;
24905 if (
sizeof(
int) <
sizeof(long)) {
24906 return PyInt_FromLong((
long) value);
24907 }
else if (
sizeof(
int) <=
sizeof(
unsigned long)) {
24908 return PyLong_FromUnsignedLong((
unsigned long) value);
24909 }
else if (
sizeof(
int) <=
sizeof(
unsigned PY_LONG_LONG)) {
24910 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24913 if (
sizeof(
int) <=
sizeof(
long)) {
24914 return PyInt_FromLong((
long) value);
24915 }
else if (
sizeof(
int) <=
sizeof(PY_LONG_LONG)) {
24916 return PyLong_FromLongLong((PY_LONG_LONG) value);
24920 int one = 1;
int little = (int)*(
unsigned char *)&one;
24921 unsigned char *bytes = (
unsigned char *)&value;
24922 return _PyLong_FromByteArray(bytes,
sizeof(
int),
24923 little, !is_unsigned);
24927 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_Py_intptr_t(Py_intptr_t value) {
24928 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
24929 const int is_unsigned = neg_one > const_zero;
24931 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
24932 return PyInt_FromLong((
long) value);
24933 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
24934 return PyLong_FromUnsignedLong((
unsigned long) value);
24935 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
24936 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
24939 if (
sizeof(Py_intptr_t) <=
sizeof(
long)) {
24940 return PyInt_FromLong((
long) value);
24941 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
24942 return PyLong_FromLongLong((PY_LONG_LONG) value);
24946 int one = 1;
int little = (int)*(
unsigned char *)&one;
24947 unsigned char *bytes = (
unsigned char *)&value;
24948 return _PyLong_FromByteArray(bytes,
sizeof(Py_intptr_t),
24949 little, !is_unsigned);
24953 static CYTHON_INLINE Py_intptr_t __Pyx_PyInt_As_Py_intptr_t(PyObject *x) {
24954 const Py_intptr_t neg_one = (Py_intptr_t) -1, const_zero = (Py_intptr_t) 0;
24955 const int is_unsigned = neg_one > const_zero;
24956 #if PY_MAJOR_VERSION < 3
24957 if (likely(PyInt_Check(x))) {
24958 if (
sizeof(Py_intptr_t) <
sizeof(long)) {
24959 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, PyInt_AS_LONG(x))
24961 long val = PyInt_AS_LONG(x);
24962 if (is_unsigned && unlikely(val < 0)) {
24963 goto raise_neg_overflow;
24965 return (Py_intptr_t) val;
24969 if (likely(PyLong_Check(x))) {
24971 #if CYTHON_USE_PYLONG_INTERNALS
24972 const digit* digits = ((PyLongObject*)x)->ob_digit;
24973 switch (Py_SIZE(x)) {
24974 case 0:
return (Py_intptr_t) 0;
24975 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, digits[0])
24977 if (8 * sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
24978 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
24979 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24980 }
else if (8 *
sizeof(Py_intptr_t) >= 2 * PyLong_SHIFT) {
24981 return (Py_intptr_t) (((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
24986 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
24987 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
24988 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24989 }
else if (8 *
sizeof(Py_intptr_t) >= 3 * PyLong_SHIFT) {
24990 return (Py_intptr_t) (((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
24995 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
24996 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
24997 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
24998 }
else if (8 *
sizeof(Py_intptr_t) >= 4 * PyLong_SHIFT) {
24999 return (Py_intptr_t) (((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0]));
25005 #if CYTHON_COMPILING_IN_CPYTHON
25006 if (unlikely(Py_SIZE(x) < 0)) {
25007 goto raise_neg_overflow;
25011 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25012 if (unlikely(result < 0))
25013 return (Py_intptr_t) -1;
25014 if (unlikely(result == 1))
25015 goto raise_neg_overflow;
25018 if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned long)) {
25019 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned long, PyLong_AsUnsignedLong(x))
25020 }
else if (
sizeof(Py_intptr_t) <=
sizeof(
unsigned PY_LONG_LONG)) {
25021 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25024 #if CYTHON_USE_PYLONG_INTERNALS
25025 const digit* digits = ((PyLongObject*)x)->ob_digit;
25026 switch (Py_SIZE(x)) {
25027 case 0:
return (Py_intptr_t) 0;
25028 case -1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, sdigit, -(sdigit) digits[0])
25029 case 1: __PYX_VERIFY_RETURN_INT(Py_intptr_t, digit, +digits[0])
25031 if (8 * sizeof(Py_intptr_t) - 1 > 1 * PyLong_SHIFT) {
25032 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25033 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25034 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
25035 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25040 if (8 *
sizeof(Py_intptr_t) > 1 * PyLong_SHIFT) {
25041 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25042 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25043 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
25044 return (Py_intptr_t) ((((((Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25049 if (8 *
sizeof(Py_intptr_t) - 1 > 2 * PyLong_SHIFT) {
25050 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25051 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25052 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
25053 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25058 if (8 *
sizeof(Py_intptr_t) > 2 * PyLong_SHIFT) {
25059 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25060 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25061 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
25062 return (Py_intptr_t) ((((((((Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25067 if (8 *
sizeof(Py_intptr_t) - 1 > 3 * PyLong_SHIFT) {
25068 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25069 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25070 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
25071 return (Py_intptr_t) (((Py_intptr_t)-1)*(((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25076 if (8 *
sizeof(Py_intptr_t) > 3 * PyLong_SHIFT) {
25077 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25078 __PYX_VERIFY_RETURN_INT(Py_intptr_t,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25079 }
else if (8 *
sizeof(Py_intptr_t) - 1 > 4 * PyLong_SHIFT) {
25080 return (Py_intptr_t) ((((((((((Py_intptr_t)digits[3]) << PyLong_SHIFT) | (Py_intptr_t)digits[2]) << PyLong_SHIFT) | (Py_intptr_t)digits[1]) << PyLong_SHIFT) | (Py_intptr_t)digits[0])));
25086 if (
sizeof(Py_intptr_t) <=
sizeof(long)) {
25087 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t,
long, PyLong_AsLong(x))
25088 }
else if (
sizeof(Py_intptr_t) <=
sizeof(PY_LONG_LONG)) {
25089 __PYX_VERIFY_RETURN_INT_EXC(Py_intptr_t, PY_LONG_LONG, PyLong_AsLongLong(x))
25093 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25094 PyErr_SetString(PyExc_RuntimeError,
25095 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25098 PyObject *v = __Pyx_PyNumber_Int(x);
25099 #if PY_MAJOR_VERSION < 3
25100 if (likely(v) && !PyLong_Check(v)) {
25102 v = PyNumber_Long(tmp);
25107 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
25108 unsigned char *bytes = (
unsigned char *)&val;
25109 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25110 bytes,
sizeof(val),
25111 is_little, !is_unsigned);
25117 return (Py_intptr_t) -1;
25121 PyObject *tmp = __Pyx_PyNumber_Int(x);
25122 if (!tmp)
return (Py_intptr_t) -1;
25123 val = __Pyx_PyInt_As_Py_intptr_t(tmp);
25128 PyErr_SetString(PyExc_OverflowError,
25129 "value too large to convert to Py_intptr_t");
25130 return (Py_intptr_t) -1;
25131 raise_neg_overflow:
25132 PyErr_SetString(PyExc_OverflowError,
25133 "can't convert negative value to Py_intptr_t");
25134 return (Py_intptr_t) -1;
25137 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(
long value) {
25138 const long neg_one = (long) -1, const_zero = (
long) 0;
25139 const int is_unsigned = neg_one > const_zero;
25141 if (
sizeof(
long) <
sizeof(long)) {
25142 return PyInt_FromLong((
long) value);
25143 }
else if (
sizeof(
long) <=
sizeof(
unsigned long)) {
25144 return PyLong_FromUnsignedLong((
unsigned long) value);
25145 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
25146 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
25149 if (
sizeof(
long) <=
sizeof(
long)) {
25150 return PyInt_FromLong((
long) value);
25151 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
25152 return PyLong_FromLongLong((PY_LONG_LONG) value);
25156 int one = 1;
int little = (int)*(
unsigned char *)&one;
25157 unsigned char *bytes = (
unsigned char *)&value;
25158 return _PyLong_FromByteArray(bytes,
sizeof(
long),
25159 little, !is_unsigned);
25163 #if CYTHON_CCOMPLEX
25165 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25166 return ::std::complex< float >(x, y);
25169 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25170 return x + y*(__pyx_t_float_complex)_Complex_I;
25174 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(
float x,
float y) {
25175 __pyx_t_float_complex z;
25182 #if CYTHON_CCOMPLEX
25184 static CYTHON_INLINE
int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25185 return (a.real == b.real) && (a.imag == b.imag);
25187 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25188 __pyx_t_float_complex z;
25189 z.real = a.real + b.real;
25190 z.imag = a.imag + b.imag;
25193 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25194 __pyx_t_float_complex z;
25195 z.real = a.real - b.real;
25196 z.imag = a.imag - b.imag;
25199 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25200 __pyx_t_float_complex z;
25201 z.real = a.real * b.real - a.imag * b.imag;
25202 z.imag = a.real * b.imag + a.imag * b.real;
25205 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25206 __pyx_t_float_complex z;
25207 float denom = b.real * b.real + b.imag * b.imag;
25208 z.real = (a.real * b.real + a.imag * b.imag) / denom;
25209 z.imag = (a.imag * b.real - a.real * b.imag) / denom;
25212 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
25213 __pyx_t_float_complex z;
25218 static CYTHON_INLINE
int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
25219 return (a.real == 0) && (a.imag == 0);
25221 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
25222 __pyx_t_float_complex z;
25228 static CYTHON_INLINE
float __Pyx_c_absf(__pyx_t_float_complex z) {
25229 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25230 return sqrtf(z.real*z.real + z.imag*z.imag);
25232 return hypotf(z.real, z.imag);
25235 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
25236 __pyx_t_float_complex z;
25237 float r, lnr, theta, z_r, z_theta;
25238 if (b.imag == 0 && b.real == (
int)b.real) {
25240 float denom = a.real * a.real + a.imag * a.imag;
25241 a.real = a.real / denom;
25242 a.imag = -a.imag / denom;
25245 switch ((
int)b.real) {
25253 z = __Pyx_c_prodf(a, a);
25254 return __Pyx_c_prodf(a, a);
25256 z = __Pyx_c_prodf(a, a);
25257 return __Pyx_c_prodf(z, a);
25259 z = __Pyx_c_prodf(a, a);
25260 return __Pyx_c_prodf(z, z);
25270 r = __Pyx_c_absf(a);
25271 theta = atan2f(a.imag, a.real);
25274 z_r = expf(lnr * b.real - theta * b.imag);
25275 z_theta = theta * b.real + lnr * b.imag;
25276 z.real = z_r * cosf(z_theta);
25277 z.imag = z_r * sinf(z_theta);
25283 #if CYTHON_CCOMPLEX
25285 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25286 return ::std::complex< double >(x, y);
25289 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25290 return x + y*(__pyx_t_double_complex)_Complex_I;
25294 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(
double x,
double y) {
25295 __pyx_t_double_complex z;
25302 #if CYTHON_CCOMPLEX
25304 static CYTHON_INLINE
int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25305 return (a.real == b.real) && (a.imag == b.imag);
25307 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25308 __pyx_t_double_complex z;
25309 z.real = a.real + b.real;
25310 z.imag = a.imag + b.imag;
25313 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25314 __pyx_t_double_complex z;
25315 z.real = a.real - b.real;
25316 z.imag = a.imag - b.imag;
25319 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25320 __pyx_t_double_complex z;
25321 z.real = a.real * b.real - a.imag * b.imag;
25322 z.imag = a.real * b.imag + a.imag * b.real;
25325 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25326 __pyx_t_double_complex z;
25327 double denom = b.real * b.real + b.imag * b.imag;
25328 z.real = (a.real * b.real + a.imag * b.imag) / denom;
25329 z.imag = (a.imag * b.real - a.real * b.imag) / denom;
25332 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
25333 __pyx_t_double_complex z;
25338 static CYTHON_INLINE
int __Pyx_c_is_zero(__pyx_t_double_complex a) {
25339 return (a.real == 0) && (a.imag == 0);
25341 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
25342 __pyx_t_double_complex z;
25348 static CYTHON_INLINE
double __Pyx_c_abs(__pyx_t_double_complex z) {
25349 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
25350 return sqrt(z.real*z.real + z.imag*z.imag);
25352 return hypot(z.real, z.imag);
25355 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
25356 __pyx_t_double_complex z;
25357 double r, lnr, theta, z_r, z_theta;
25358 if (b.imag == 0 && b.real == (
int)b.real) {
25360 double denom = a.real * a.real + a.imag * a.imag;
25361 a.real = a.real / denom;
25362 a.imag = -a.imag / denom;
25365 switch ((
int)b.real) {
25373 z = __Pyx_c_prod(a, a);
25374 return __Pyx_c_prod(a, a);
25376 z = __Pyx_c_prod(a, a);
25377 return __Pyx_c_prod(z, a);
25379 z = __Pyx_c_prod(a, a);
25380 return __Pyx_c_prod(z, z);
25390 r = __Pyx_c_abs(a);
25391 theta = atan2(a.imag, a.real);
25394 z_r = exp(lnr * b.real - theta * b.imag);
25395 z_theta = theta * b.real + lnr * b.imag;
25396 z.real = z_r * cos(z_theta);
25397 z.imag = z_r * sin(z_theta);
25403 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(
enum NPY_TYPES value) {
25404 const enum NPY_TYPES neg_one = (
enum NPY_TYPES) -1, const_zero = (
enum NPY_TYPES) 0;
25405 const int is_unsigned = neg_one > const_zero;
25407 if (
sizeof(
enum NPY_TYPES) <
sizeof(long)) {
25408 return PyInt_FromLong((
long) value);
25409 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned long)) {
25410 return PyLong_FromUnsignedLong((
unsigned long) value);
25411 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(
unsigned PY_LONG_LONG)) {
25412 return PyLong_FromUnsignedLongLong((
unsigned PY_LONG_LONG) value);
25415 if (
sizeof(
enum NPY_TYPES) <=
sizeof(
long)) {
25416 return PyInt_FromLong((
long) value);
25417 }
else if (
sizeof(
enum NPY_TYPES) <=
sizeof(PY_LONG_LONG)) {
25418 return PyLong_FromLongLong((PY_LONG_LONG) value);
25422 int one = 1;
int little = (int)*(
unsigned char *)&one;
25423 unsigned char *bytes = (
unsigned char *)&value;
25424 return _PyLong_FromByteArray(bytes,
sizeof(
enum NPY_TYPES),
25425 little, !is_unsigned);
25429 static CYTHON_INLINE
long __Pyx_PyInt_As_long(PyObject *x) {
25430 const long neg_one = (long) -1, const_zero = (
long) 0;
25431 const int is_unsigned = neg_one > const_zero;
25432 #if PY_MAJOR_VERSION < 3
25433 if (likely(PyInt_Check(x))) {
25434 if (
sizeof(
long) <
sizeof(long)) {
25435 __PYX_VERIFY_RETURN_INT(
long,
long, PyInt_AS_LONG(x))
25437 long val = PyInt_AS_LONG(x);
25438 if (is_unsigned && unlikely(val < 0)) {
25439 goto raise_neg_overflow;
25445 if (likely(PyLong_Check(x))) {
25447 #if CYTHON_USE_PYLONG_INTERNALS
25448 const digit* digits = ((PyLongObject*)x)->ob_digit;
25449 switch (Py_SIZE(x)) {
25450 case 0:
return (
long) 0;
25451 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, digits[0])
25453 if (8 * sizeof(
long) > 1 * PyLong_SHIFT) {
25454 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25455 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25456 }
else if (8 *
sizeof(
long) >= 2 * PyLong_SHIFT) {
25457 return (
long) (((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
25462 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
25463 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25464 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25465 }
else if (8 *
sizeof(
long) >= 3 * PyLong_SHIFT) {
25466 return (
long) (((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
25471 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
25472 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25473 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25474 }
else if (8 *
sizeof(
long) >= 4 * PyLong_SHIFT) {
25475 return (
long) (((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0]));
25481 #if CYTHON_COMPILING_IN_CPYTHON
25482 if (unlikely(Py_SIZE(x) < 0)) {
25483 goto raise_neg_overflow;
25487 int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
25488 if (unlikely(result < 0))
25490 if (unlikely(result == 1))
25491 goto raise_neg_overflow;
25494 if (
sizeof(
long) <=
sizeof(
unsigned long)) {
25495 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned long, PyLong_AsUnsignedLong(x))
25496 }
else if (
sizeof(
long) <=
sizeof(
unsigned PY_LONG_LONG)) {
25497 __PYX_VERIFY_RETURN_INT_EXC(
long,
unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
25500 #if CYTHON_USE_PYLONG_INTERNALS
25501 const digit* digits = ((PyLongObject*)x)->ob_digit;
25502 switch (Py_SIZE(x)) {
25503 case 0:
return (
long) 0;
25504 case -1: __PYX_VERIFY_RETURN_INT(
long, sdigit, -(sdigit) digits[0])
25505 case 1: __PYX_VERIFY_RETURN_INT(
long, digit, +digits[0])
25507 if (8 * sizeof(
long) - 1 > 1 * PyLong_SHIFT) {
25508 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25509 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25510 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25511 return (
long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
25516 if (8 *
sizeof(
long) > 1 * PyLong_SHIFT) {
25517 if (8 *
sizeof(
unsigned long) > 2 * PyLong_SHIFT) {
25518 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25519 }
else if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25520 return (
long) ((((((long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
25525 if (8 *
sizeof(
long) - 1 > 2 * PyLong_SHIFT) {
25526 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25527 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25528 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25529 return (
long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25534 if (8 *
sizeof(
long) > 2 * PyLong_SHIFT) {
25535 if (8 *
sizeof(
unsigned long) > 3 * PyLong_SHIFT) {
25536 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25537 }
else if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25538 return (
long) ((((((((long)digits[2]) << PyLong_SHIFT) | (
long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
25543 if (8 *
sizeof(
long) - 1 > 3 * PyLong_SHIFT) {
25544 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25545 __PYX_VERIFY_RETURN_INT(
long,
long, -(
long) (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25546 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25547 return (
long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
25552 if (8 *
sizeof(
long) > 3 * PyLong_SHIFT) {
25553 if (8 *
sizeof(
unsigned long) > 4 * PyLong_SHIFT) {
25554 __PYX_VERIFY_RETURN_INT(
long,
unsigned long, (((((((((
unsigned long)digits[3]) << PyLong_SHIFT) | (
unsigned long)digits[2]) << PyLong_SHIFT) | (
unsigned long)digits[1]) << PyLong_SHIFT) | (
unsigned long)digits[0])))
25555 }
else if (8 *
sizeof(
long) - 1 > 4 * PyLong_SHIFT) {
25556 return (
long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (
long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (
long)digits[0])));
25562 if (
sizeof(
long) <=
sizeof(long)) {
25563 __PYX_VERIFY_RETURN_INT_EXC(
long,
long, PyLong_AsLong(x))
25564 }
else if (
sizeof(
long) <=
sizeof(PY_LONG_LONG)) {
25565 __PYX_VERIFY_RETURN_INT_EXC(
long, PY_LONG_LONG, PyLong_AsLongLong(x))
25569 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
25570 PyErr_SetString(PyExc_RuntimeError,
25571 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
25574 PyObject *v = __Pyx_PyNumber_Int(x);
25575 #if PY_MAJOR_VERSION < 3
25576 if (likely(v) && !PyLong_Check(v)) {
25578 v = PyNumber_Long(tmp);
25583 int one = 1;
int is_little = (int)*(
unsigned char *)&one;
25584 unsigned char *bytes = (
unsigned char *)&val;
25585 int ret = _PyLong_AsByteArray((PyLongObject *)v,
25586 bytes,
sizeof(val),
25587 is_little, !is_unsigned);
25597 PyObject *tmp = __Pyx_PyNumber_Int(x);
25598 if (!tmp)
return (
long) -1;
25599 val = __Pyx_PyInt_As_long(tmp);
25604 PyErr_SetString(PyExc_OverflowError,
25605 "value too large to convert to long");
25607 raise_neg_overflow:
25608 PyErr_SetString(PyExc_OverflowError,
25609 "can't convert negative value to long");
25613 static int __Pyx_check_binary_version(
void) {
25614 char ctversion[4], rtversion[4];
25615 PyOS_snprintf(ctversion, 4,
"%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
25616 PyOS_snprintf(rtversion, 4,
"%s", Py_GetVersion());
25617 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
25619 PyOS_snprintf(message,
sizeof(message),
25620 "compiletime version %s of module '%.100s' "
25621 "does not match runtime version %s",
25622 ctversion, __Pyx_MODULE_NAME, rtversion);
25623 return PyErr_WarnEx(NULL, message, 1);
25628 #ifndef __PYX_HAVE_RT_ImportModule
25629 #define __PYX_HAVE_RT_ImportModule
25630 static PyObject *__Pyx_ImportModule(
const char *name) {
25631 PyObject *py_name = 0;
25632 PyObject *py_module = 0;
25633 py_name = __Pyx_PyIdentifier_FromString(name);
25636 py_module = PyImport_Import(py_name);
25637 Py_DECREF(py_name);
25640 Py_XDECREF(py_name);
25645 #ifndef __PYX_HAVE_RT_ImportType
25646 #define __PYX_HAVE_RT_ImportType
25647 static PyTypeObject *__Pyx_ImportType(
const char *module_name,
const char *class_name,
25648 size_t size,
int strict)
25650 PyObject *py_module = 0;
25651 PyObject *result = 0;
25652 PyObject *py_name = 0;
25654 Py_ssize_t basicsize;
25655 #ifdef Py_LIMITED_API
25656 PyObject *py_basicsize;
25658 py_module = __Pyx_ImportModule(module_name);
25661 py_name = __Pyx_PyIdentifier_FromString(class_name);
25664 result = PyObject_GetAttr(py_module, py_name);
25665 Py_DECREF(py_name);
25667 Py_DECREF(py_module);
25671 if (!PyType_Check(result)) {
25672 PyErr_Format(PyExc_TypeError,
25673 "%.200s.%.200s is not a type object",
25674 module_name, class_name);
25677 #ifndef Py_LIMITED_API
25678 basicsize = ((PyTypeObject *)result)->tp_basicsize;
25680 py_basicsize = PyObject_GetAttrString(result,
"__basicsize__");
25683 basicsize = PyLong_AsSsize_t(py_basicsize);
25684 Py_DECREF(py_basicsize);
25686 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
25689 if (!strict && (
size_t)basicsize > size) {
25690 PyOS_snprintf(warning,
sizeof(warning),
25691 "%s.%s size changed, may indicate binary incompatibility",
25692 module_name, class_name);
25693 if (PyErr_WarnEx(NULL, warning, 0) < 0)
goto bad;
25695 else if ((
size_t)basicsize != size) {
25696 PyErr_Format(PyExc_ValueError,
25697 "%.200s.%.200s has the wrong size, try recompiling",
25698 module_name, class_name);
25701 return (PyTypeObject *)result;
25703 Py_XDECREF(py_module);
25704 Py_XDECREF(result);
25709 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
25711 #if PY_MAJOR_VERSION < 3
25712 if (t->is_unicode) {
25713 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
25714 }
else if (t->intern) {
25715 *t->p = PyString_InternFromString(t->s);
25717 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
25720 if (t->is_unicode | t->is_str) {
25722 *t->p = PyUnicode_InternFromString(t->s);
25723 }
else if (t->encoding) {
25724 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
25726 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
25729 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
25739 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(
const char* c_str) {
25740 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
25742 static CYTHON_INLINE
char* __Pyx_PyObject_AsString(PyObject* o) {
25744 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
25746 static CYTHON_INLINE
char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
25747 #if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
25749 #
if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25750 __Pyx_sys_getdefaultencoding_not_ascii &&
25752 PyUnicode_Check(o)) {
25753 #if PY_VERSION_HEX < 0x03030000
25755 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
25756 if (!defenc)
return NULL;
25757 defenc_c = PyBytes_AS_STRING(defenc);
25758 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25760 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
25762 for (c = defenc_c; c < end; c++) {
25763 if ((
unsigned char) (*c) >= 128) {
25764 PyUnicode_AsASCIIString(o);
25770 *length = PyBytes_GET_SIZE(defenc);
25773 if (__Pyx_PyUnicode_READY(o) == -1)
return NULL;
25774 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
25775 if (PyUnicode_IS_ASCII(o)) {
25776 *length = PyUnicode_GET_LENGTH(o);
25777 return PyUnicode_AsUTF8(o);
25779 PyUnicode_AsASCIIString(o);
25783 return PyUnicode_AsUTF8AndSize(o, length);
25788 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
25789 if (PyByteArray_Check(o)) {
25790 *length = PyByteArray_GET_SIZE(o);
25791 return PyByteArray_AS_STRING(o);
25796 int r = PyBytes_AsStringAndSize(o, &result, length);
25797 if (unlikely(r < 0)) {
25804 static CYTHON_INLINE
int __Pyx_PyObject_IsTrue(PyObject* x) {
25805 int is_true = x == Py_True;
25806 if (is_true | (x == Py_False) | (x == Py_None))
return is_true;
25807 else return PyObject_IsTrue(x);
25809 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
25810 PyNumberMethods *m;
25811 const char *name = NULL;
25812 PyObject *res = NULL;
25813 #if PY_MAJOR_VERSION < 3
25814 if (PyInt_Check(x) || PyLong_Check(x))
25816 if (PyLong_Check(x))
25818 return __Pyx_NewRef(x);
25819 m = Py_TYPE(x)->tp_as_number;
25820 #if PY_MAJOR_VERSION < 3
25821 if (m && m->nb_int) {
25823 res = PyNumber_Int(x);
25825 else if (m && m->nb_long) {
25827 res = PyNumber_Long(x);
25830 if (m && m->nb_int) {
25832 res = PyNumber_Long(x);
25836 #if PY_MAJOR_VERSION < 3
25837 if (!PyInt_Check(res) && !PyLong_Check(res)) {
25839 if (!PyLong_Check(res)) {
25841 PyErr_Format(PyExc_TypeError,
25842 "__%.4s__ returned non-%.4s (type %.200s)",
25843 name, name, Py_TYPE(res)->tp_name);
25848 else if (!PyErr_Occurred()) {
25849 PyErr_SetString(PyExc_TypeError,
25850 "an integer is required");
25854 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
25857 #if PY_MAJOR_VERSION < 3
25858 if (likely(PyInt_CheckExact(b))) {
25859 if (
sizeof(Py_ssize_t) >=
sizeof(
long))
25860 return PyInt_AS_LONG(b);
25862 return PyInt_AsSsize_t(x);
25865 if (likely(PyLong_CheckExact(b))) {
25866 #if CYTHON_USE_PYLONG_INTERNALS
25867 const digit* digits = ((PyLongObject*)b)->ob_digit;
25868 const Py_ssize_t size = Py_SIZE(b);
25869 if (likely(__Pyx_sst_abs(size) <= 1)) {
25870 ival = likely(size) ? digits[0] : 0;
25871 if (size == -1) ival = -ival;
25876 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25877 return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25881 if (8 *
sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
25882 return -(Py_ssize_t) (((((
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25886 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25887 return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25891 if (8 *
sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
25892 return -(Py_ssize_t) (((((((
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25896 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25897 return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (
size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (
size_t)digits[0]));
25901 if (8 *
sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
25902 return -(Py_ssize_t) (((((((((
size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (
size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
25908 return PyLong_AsSsize_t(b);
25910 x = PyNumber_Index(b);
25912 ival = PyInt_AsSsize_t(x);
25916 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(
size_t ival) {
25917 return PyInt_FromSize_t(ival);